public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately
@ 2014-06-07 5:54 su at cs dot ucdavis.edu
2014-06-08 21:19 ` [Bug tree-optimization/61437] [4.10 Regression] " jakub at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-06-07 5:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61437
Bug ID: 61437
Summary: wrong code on x86_64-linux-gnu when compile separately
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
The current gcc trunk miscompiles the following files (foo.c and main.c) on
x86_64-linux in both 32-bit and 64-bit modes.
This is a regression from 4.9.x.
The merged file (merged.c) does not trigger the bug.
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140606 (experimental) [trunk revision 211322] (GCC)
$
$ gcc-trunk -O2 -c foo.c
$ gcc-trunk -O2 -c main.c
$ gcc-trunk -O2 foo.o main.o
$ a.out
a.out: foo.c:9: foo: Assertion `b == 0' failed.
Aborted (core dumped)
$
$ gcc-4.9.0 -O2 -c foo.c
$ gcc-4.9.0 -O2 -c main.c
$ gcc-4.9.0 -O2 foo.o main.o
$ a.out
$
$ gcc-trunk -O2 merged.c
$ a.out
$
$ cat foo.c
#include <assert.h>
extern int *b, **c;
int foo (void)
{
int *t = 0;
*c = t;
assert (b == 0);
}
$ cat main.c
extern int foo (void);
int a, *b = &a, **c = &b;
int main (void)
{
foo ();
return 0;
}
$
$ cat merged.c
#include <assert.h>
int a;
int *b = &a;
int **c = &b;
int
foo ()
{
int *t = 0;
*c = t;
assert (b == 0);
}
int
main ()
{
foo ();
return 0;
}
$
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/61437] [4.10 Regression] wrong code on x86_64-linux-gnu when compile separately
2014-06-07 5:54 [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately su at cs dot ucdavis.edu
@ 2014-06-08 21:19 ` jakub at gcc dot gnu.org
2014-06-10 10:12 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-06-08 21:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61437
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-06-08
CC| |jakub at gcc dot gnu.org
Target Milestone|--- |4.10.0
Summary|wrong code on |[4.10 Regression] wrong
|x86_64-linux-gnu when |code on x86_64-linux-gnu
|compile separately |when compile separately
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r211233.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/61437] [4.10 Regression] wrong code on x86_64-linux-gnu when compile separately
2014-06-07 5:54 [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately su at cs dot ucdavis.edu
2014-06-08 21:19 ` [Bug tree-optimization/61437] [4.10 Regression] " jakub at gcc dot gnu.org
@ 2014-06-10 10:12 ` rguenth at gcc dot gnu.org
2014-06-11 7:36 ` rguenth at gcc dot gnu.org
2014-06-11 7:39 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-10 10:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61437
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Eric has already posted a similar testcase and I have a patch.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/61437] [4.10 Regression] wrong code on x86_64-linux-gnu when compile separately
2014-06-07 5:54 [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately su at cs dot ucdavis.edu
2014-06-08 21:19 ` [Bug tree-optimization/61437] [4.10 Regression] " jakub at gcc dot gnu.org
2014-06-10 10:12 ` rguenth at gcc dot gnu.org
@ 2014-06-11 7:36 ` rguenth at gcc dot gnu.org
2014-06-11 7:39 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-11 7:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61437
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Jun 11 07:35:36 2014
New Revision: 211436
URL: http://gcc.gnu.org/viewcvs?rev=211436&root=gcc&view=rev
Log:
2014-06-11 Richard Biener <rguenther@suse.de>
PR middle-end/61437
Revert
2014-06-04 Richard Biener <rguenther@suse.de>
* tree.h (may_be_aliased): Trust TREE_ADDRESSABLE from
TREE_PUBLIC and DECL_EXTERNAL decls.
* gcc.dg/torture/20140610-1.c: New testcase.
* gcc.dg/torture/20140610-2.c: Likewise.
Added:
trunk/gcc/testsuite/gcc.dg/torture/20140610-1.c
trunk/gcc/testsuite/gcc.dg/torture/20140610-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree.h
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/61437] [4.10 Regression] wrong code on x86_64-linux-gnu when compile separately
2014-06-07 5:54 [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately su at cs dot ucdavis.edu
` (2 preceding siblings ...)
2014-06-11 7:36 ` rguenth at gcc dot gnu.org
@ 2014-06-11 7:39 ` rguenth at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-11 7:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61437
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed by reversion.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-06-11 7:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-07 5:54 [Bug tree-optimization/61437] New: wrong code on x86_64-linux-gnu when compile separately su at cs dot ucdavis.edu
2014-06-08 21:19 ` [Bug tree-optimization/61437] [4.10 Regression] " jakub at gcc dot gnu.org
2014-06-10 10:12 ` rguenth at gcc dot gnu.org
2014-06-11 7:36 ` rguenth at gcc dot gnu.org
2014-06-11 7:39 ` rguenth 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).