This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/41805] New: possible LTO termination bug


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]