public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
@ 2014-07-28  4:44 ` pinskia at gcc dot gnu.org
  2014-12-09 19:26 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-07-28  4:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This code is undefined due to the arguments passed to printf. Please correct
that and try again.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
  2014-07-28  4:44 ` [Bug tree-optimization/61931] Wrong Constant Folding pinskia at gcc dot gnu.org
@ 2014-12-09 19:26 ` mpolacek at gcc dot gnu.org
  2014-12-18  7:56 ` ishiura-compiler at ml dot kwansei.ac.jp
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-12-09 19:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-12-09
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
  2014-07-28  4:44 ` [Bug tree-optimization/61931] Wrong Constant Folding pinskia at gcc dot gnu.org
  2014-12-09 19:26 ` mpolacek at gcc dot gnu.org
@ 2014-12-18  7:56 ` ishiura-compiler at ml dot kwansei.ac.jp
  2014-12-20 19:38 ` mikpelinux at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: ishiura-compiler at ml dot kwansei.ac.jp @ 2014-12-18  7:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

--- Comment #2 from Ishiura Lab Compiler Team <ishiura-compiler at ml dot kwansei.ac.jp> ---
We are sorry for having reported an error program with undefined behavior.
We have redone minimization. The resulting program is as follows.

$ cat test.c

int a = 1;
int b = 0;
int c = 1;
int d = 1;
long long e = 2LL;
long long f = 1LL;
unsigned long long g = 0xFFFFFFFFFFFFFFFFLLU;

int main (void)
{
  int       h = 1;
  int       i = (1 / a) - 1;       
  int       j = h << (i <= 1U);    
  long long k = 1LL << (g + 3LLU); 
  long long l = k >> 1;            
  long long m = (b | l) / 3;       
  long long n = (a - m) | 1;       
  long long o = 1 - ((0 | n) ^ j); 
  long long p = 1 | (3 * f);       
  long long q = p << (a <= 0);     
  long long r = (e & 2) % 3;       
            c = r <= (q || d);     
  long long s = (1LL % d) * a;     

  if (o != -2LL) __builtin_printf ("o = %lld\n", o);
  if (s !=  0LL) __builtin_printf ("%lld", 0LL);

  return 0;
}

$ arm-none-eabi-gcc-4.8.4 test.c -o test.out -O2 --specs=rdimon.specs
$ qemu-arm -L /usr/arm-linux-gnueabihf/ ./test.out
o = 164686225997822

$ arm-none-eabi-gcc-4.8.4 test.c -o test.out -O1 --specs=rdimon.specs
$ qemu-arm -L /usr/arm-linux-gnueabihf/ ./test.out


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-12-18  7:56 ` ishiura-compiler at ml dot kwansei.ac.jp
@ 2014-12-20 19:38 ` mikpelinux at gmail dot com
  2014-12-20 21:42 ` mikpelinux at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2014-12-20 19:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

Mikael Pettersson <mikpelinux at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpelinux at gmail dot com

--- Comment #3 from Mikael Pettersson <mikpelinux at gmail dot com> ---
I can reproduce with 4.8.4 targeting arm-eabi, but not with 4.9.2, and not with
4.8.4 targeting arm-linux-gnueabi.  I'll do a bisection to see if I can find
what fixed it.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-12-20 19:38 ` mikpelinux at gmail dot com
@ 2014-12-20 21:42 ` mikpelinux at gmail dot com
  2014-12-21 16:06 ` mikpelinux at gmail dot com
  2015-10-20  9:28 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2014-12-20 21:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

--- Comment #4 from Mikael Pettersson <mikpelinux at gmail dot com> ---
This was fixed for 4.9 by r197965.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-12-20 21:42 ` mikpelinux at gmail dot com
@ 2014-12-21 16:06 ` mikpelinux at gmail dot com
  2015-10-20  9:28 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mikpelinux at gmail dot com @ 2014-12-21 16:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

--- Comment #5 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Created attachment 34307
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34307&action=edit
backport of r197965 (without neon bits) + testcase

Patch which fixes this testcase; I'll do a full bootstrap and testsuite run
with it next week.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61931] Wrong Constant Folding
       [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-12-21 16:06 ` mikpelinux at gmail dot com
@ 2015-10-20  9:28 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-20  9:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61931

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Should be fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-20  9:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-61931-4@http.gcc.gnu.org/bugzilla/>
2014-07-28  4:44 ` [Bug tree-optimization/61931] Wrong Constant Folding pinskia at gcc dot gnu.org
2014-12-09 19:26 ` mpolacek at gcc dot gnu.org
2014-12-18  7:56 ` ishiura-compiler at ml dot kwansei.ac.jp
2014-12-20 19:38 ` mikpelinux at gmail dot com
2014-12-20 21:42 ` mikpelinux at gmail dot com
2014-12-21 16:06 ` mikpelinux at gmail dot com
2015-10-20  9:28 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).