http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56890



--- Comment #6 from Martin <windward at gmx dot com> 2013-04-11 09:21:54 UTC ---

Created attachment 29854

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29854

Results of testcase with -O0 to -O3 for gcc 4.7.2 and 4.8.0



Output (stdout+stderr, assembler file) of Rainer's bigger testcase.



Ran a short testcase with gcc 4.7.2 and 4.8.0, each called with -O0 to -O3.

Other parameters were -m64 -save-temps -Wall -Wextra -fno-strict-aliasing

-fwrapv. Assembler was GNU assembler (GNU Binutils) 2.23.1. More details

available if needed.



gcc 4.8.0 compiles fine except for a warning:



test.c: In function 'buggy':

test.c:6:67: warning: 'num16' may be used uninitialized in this function

[-Wmaybe-uninitialized]

         num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 +

1.0)));

                                                                   ^

test.c:10:71: warning: 'number' may be used uninitialized in this function

[-Wmaybe-uninitialized]

         (number) = min + (long) ((double) (max - min + 1.0) * (number /

(4294967295U + 1.0)));

                                                                       ^

gcc 4.7.2 fails for anything but -O0:



::::::::::::::

gcc472_O0_out

::::::::::::::

test.c: In function 'buggy':

test.c:6:67: warning: 'num16' may be used uninitialized in this function

[-Wuninitialized]

test.c:10:71: warning: 'number' may be used uninitialized in this function

[-Wuninitialized]

::::::::::::::

gcc472_O1_out

::::::::::::::

test.c: In function 'buggy':

test.c:6:67: warning: 'num16' may be used uninitialized in this function

[-Wuninitialized]

test.c:10:71: warning: 'number' may be used uninitialized in this function

[-Wuninitialized]

test.c:13:1: error: insn does not satisfy its constraints:

(insn 127 42 43 3 (set (reg:HI 40 %f8 [162])

        (reg:HI 42 %f10)) test.c:6 58 {*movhi_insn}

     (nil))

test.c:13:1: internal compiler error: in reload_cse_simplify_operands, at

postreload.c:403

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

::::::::::::::

gcc472_O2_out

::::::::::::::

test.c: In function 'buggy':

test.c:6:67: warning: 'num16' may be used uninitialized in this function

[-Wuninitialized]

test.c:10:71: warning: 'number' may be used uninitialized in this function

[-Wuninitialized]

test.s: Assembler messages:

test.s:35: Error: Illegal operands

::::::::::::::

gcc472_O3_out

::::::::::::::

test.c: In function 'buggy':

test.c:6:67: warning: 'num16' may be used uninitialized in this function

[-Wuninitialized]

test.c:10:71: warning: 'number' may be used uninitialized in this function

[-Wuninitialized]

test.s: Assembler messages:

test.s:35: Error: Illegal operands



Hope that helps.



Cheers,



Martin

Reply via email to