public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/57568] New: wrong code for assignment in conditional at -Os
@ 2013-06-08 19:16 dhazeghi at yahoo dot com
  2013-06-08 20:06 ` [Bug rtl-optimization/57568] [4.8/4.9 Regression] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: dhazeghi at yahoo dot com @ 2013-06-08 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57568
           Summary: wrong code for assignment in conditional at -Os
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dhazeghi at yahoo dot com

The following code is miscompiled by gcc trunk and 4.8 on x86_64-linux at -Os
and above optimization levels in 32-bit mode (should print nothing).  This is a
regression from 4.7.x.

$ gcc-trunk -v
gcc version 4.9.0 20130608 (experimental) [trunk revision 199849] (GCC) 
$ gcc-trunk -O1 -m32 reduced.c 
$ ./a.out 
$ gcc-4.7 -Os -m32 reduced.c 
$ ./a.out 
$ gcc-trunk -Os -m32 reduced.c 
$ ./a.out 
1
$
---------------
int printf (const char *, ...);

int a[6][9] = {};
int b = 1;
int *c = &a[3][5];

int main ()
{
  if (b)
    if (*c = *c + *c)
      printf ("%d\n", a[3][5]);

  return 0;
}


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

end of thread, other threads:[~2013-06-09 21:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-08 19:16 [Bug rtl-optimization/57568] New: wrong code for assignment in conditional at -Os dhazeghi at yahoo dot com
2013-06-08 20:06 ` [Bug rtl-optimization/57568] [4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-06-08 20:07 ` jakub at gcc dot gnu.org
2013-06-09 18:43 ` jakub at gcc dot gnu.org
2013-06-09 20:48 ` dhazeghi at yahoo dot com
2013-06-09 21:11 ` jakub 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).