Public bug reported:

I think gcc (4.6.3-1ubuntu5, amd64) generates incorrect code with the
attached test case.

The expected output is "m = 8241071186". However, when compiled with
"-O3", it outputs "m = 1". Looking further, it seems that the following
lines:

       *m = 1UL;
      ularith_div_2ul_ul_ul_r (m, 0UL, 1UL, s);

are being swapped in the assembly output.

The output is correct when compiled with "-O2" or with "-O3 -fno-tree-
cselim".

On Debian (version 4.6.3-1), the output is always correct. I have
reports that the output is correct with upstream gcc compiled on Ubuntu,
so this behaviour looks Ubuntu-specific.

** Affects: gcc-4.6 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1029454

Title:
  cselim tree optimizer generates incorrect code

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1029454/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to