public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/41805] New: possible LTO termination bug
@ 2009-10-23 2:48 regehr at cs dot utah dot edu
2009-10-23 2:50 ` [Bug c/41805] " regehr at cs dot utah dot edu
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: regehr at cs dot utah dot edu @ 2009-10-23 2:48 UTC (permalink / raw)
To: gcc-bugs
Using r153474 with LTO, the compilation units below appear to be improperly
turned into a terminating executable.
regehr@john-home:~$ current-gcc -g -Wall -O3 -flto -c rnd_output0.c
regehr@john-home:~$ current-gcc -g -Wall -O3 -flto -c rnd_output1.c
regehr@john-home:~$ current-gcc -g -Wall -O3 -flto rnd_output1.o rnd_output0.o
-o rand
regehr@john-home:~$ ./rand
Done
regehr@john-home:~$
regehr@john-home:~$ cat rnd_output0.c
#include <assert.h>
#include <stdio.h>
int func_5();
int i = 0;
int func_2()
{
func_5();
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
assert(i == 0);
return 0;
}
int func_1(int p)
{
func_2();
return 0;
}
int main(void)
{
func_1(func_2());
printf ("Done\n");
return 0;
}
regehr@john-home:~$ cat rnd_output1.c
int func_5()
{
while(1)
;
return 0;
}
--
Summary: possible LTO termination bug
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
@ 2009-10-23 2:50 ` regehr at cs dot utah dot edu
2009-10-23 2:56 ` [Bug middle-end/41805] " pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: regehr at cs dot utah dot edu @ 2009-10-23 2:50 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from regehr at cs dot utah dot edu 2009-10-23 02:50 -------
Forgot to add gcc details:
regehr@john-home:~$ current-gcc -v
Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/home/regehr/z/tmp/gcc-r153474-install/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/tmp/gcc-r153474-install --program-prefix=r153474-
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20091022 (experimental) (GCC)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
2009-10-23 2:50 ` [Bug c/41805] " regehr at cs dot utah dot edu
@ 2009-10-23 2:56 ` pinskia at gcc dot gnu dot org
2009-10-23 10:04 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-10-23 2:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2009-10-23 02:56 -------
Sounds like pure/const pass is messing up.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu dot
| |org
Component|c |middle-end
Keywords| |wrong-code
Version|unknown |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
2009-10-23 2:50 ` [Bug c/41805] " regehr at cs dot utah dot edu
2009-10-23 2:56 ` [Bug middle-end/41805] " pinskia at gcc dot gnu dot org
@ 2009-10-23 10:04 ` rguenth at gcc dot gnu dot org
2009-10-23 10:17 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-23 10:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2009-10-23 10:04 -------
It is RTL expansion that drops the calls to func_2 () from main.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-10-23 10:04:23
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
` (2 preceding siblings ...)
2009-10-23 10:04 ` rguenth at gcc dot gnu dot org
@ 2009-10-23 10:17 ` rguenth at gcc dot gnu dot org
2009-10-23 10:21 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-23 10:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-10-23 10:17 -------
I have a patch.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2009-10-23 10:04:23 |2009-10-23 10:17:09
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
` (3 preceding siblings ...)
2009-10-23 10:17 ` rguenth at gcc dot gnu dot org
@ 2009-10-23 10:21 ` rguenth at gcc dot gnu dot org
2009-10-23 12:01 ` rguenth at gcc dot gnu dot org
2009-10-23 13:16 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-23 10:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2009-10-23 10:20 -------
Non-LTO testcase:
void __attribute__((noinline))
foo (void)
{
while (1)
;
}
int main()
{
foo ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
` (4 preceding siblings ...)
2009-10-23 10:21 ` rguenth at gcc dot gnu dot org
@ 2009-10-23 12:01 ` rguenth at gcc dot gnu dot org
2009-10-23 13:16 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-23 12:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from rguenth at gcc dot gnu dot org 2009-10-23 12:01 -------
Subject: Bug 41805
Author: rguenth
Date: Fri Oct 23 12:01:21 2009
New Revision: 153495
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153495
Log:
2009-10-23 Richard Guenther <rguenther@suse.de>
PR middle-end/41805
* cfgexpand.c (expand_call_stmt): Use gimple_has_side_effects and
gimple_call_nothrow_p.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug middle-end/41805] possible LTO termination bug
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
` (5 preceding siblings ...)
2009-10-23 12:01 ` rguenth at gcc dot gnu dot org
@ 2009-10-23 13:16 ` rguenth at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-10-23 13:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2009-10-23 13:16 -------
Fixed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41805
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-10-23 13:16 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-23 2:48 [Bug c/41805] New: possible LTO termination bug regehr at cs dot utah dot edu
2009-10-23 2:50 ` [Bug c/41805] " regehr at cs dot utah dot edu
2009-10-23 2:56 ` [Bug middle-end/41805] " pinskia at gcc dot gnu dot org
2009-10-23 10:04 ` rguenth at gcc dot gnu dot org
2009-10-23 10:17 ` rguenth at gcc dot gnu dot org
2009-10-23 10:21 ` rguenth at gcc dot gnu dot org
2009-10-23 12:01 ` rguenth at gcc dot gnu dot org
2009-10-23 13:16 ` rguenth at gcc dot gnu dot 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).