Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong optimization: instability of x87 floating-point results leads to nonsense #44218

Open
Labels
@llvmbot

Description

@llvmbot
Bugzilla Link44873
Versiontrunk
OSLinux
ReporterLLVM Bugzilla Contributor
CC@topperc,@LebedevRI,@RKSimon,@rotateright,@vinc17fr

Extended Description

x87 floating-point results are effectively unstable due to possible excess precision. Without extra care, this instability can taint everything around and lead to nonsense.

Instability is not limited to FP numbers, it extends to integers too:

#include<stdio.h>__attribute__((noipa,optnone))// imagine it in a separate TUstaticintopaque(inti) {returni; }intmain(){intz=opaque(1)+0x1p-60==1;printf("z = %d\n",z);if (z)puts("z is one");}
$clang -std=c11 -pedantic -Wall -Wextra -Wno-unknown-attributes -m32 -march=i686 -O3 test.c&& ./a.outz = 0z is one
----------------------------------------------------------------------clang x86-64 version: clang version 11.0.0 (https://github.com/llvm/llvm-project 14ecbd7b8ded18af6c95f6a9957da541d1ec0e80)----------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp