[4.8/4.9 Regression] cc1plus doesn't terminate when called with -g on arm-linux-gnueabihf

Bug #1352417 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Confirmed
Medium
gcc-4.8 (Ubuntu)
New
Undecided
Unassigned
gcc-4.9 (Debian)
Fix Released
Unknown
gcc-4.9 (Ubuntu)
New
Undecided
Unassigned

Bug Description

seen on the 4.8 and 4.9 branch, cc1plus doesn't terminate. omitting the -g lets the command succeed.

$ g++ -v -std=c++0x -c -g -O2 qmltextgenerator.cpp

Program received signal SIGINT, Interrupt.
0x0054920c in canonicalize_values_star(variable_def**, dataflow_set_def*) ()
(gdb) bt
#0 0x0054920c in canonicalize_values_star(variable_def**, dataflow_set_def*)
    ()
#1 0x0054b0c2 in ?? ()
#2 0x0054ca08 in ?? ()
#3 0x0054d8ba in ?? ()
#4 0x0039928a in execute_one_pass(opt_pass*) ()
#5 0x00399448 in execute_pass_list(opt_pass*) ()
#6 0x00399452 in execute_pass_list(opt_pass*) ()
#7 0x00399452 in execute_pass_list(opt_pass*) ()
#8 0x00244a8c in ?? ()
#9 0x00245ca4 in compile() ()
#10 0x00246030 in finalize_compilation_unit() ()
#11 0x00158fc4 in cp_write_global_declarations() ()
#12 0x00409394 in ?? ()
#13 0x0040aad0 in toplev_main(int, char**) ()
#14 0xb6d4f630 in __libc_start_main (main=0x111e19 <main>, argc=26,
    argv=0xbefff604, init=<optimized out>, fini=0x7b2af5 <__libc_csu_fini>,
    rtld_fini=0xb6fe24e5 <_dl_fini>, stack_end=0xbefff604) at libc-start.c:287
#15 0x00112058 in _start ()

defaults are -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb

Revision history for this message
In , Michael Collison (michael-collison) wrote :

Created attachment 32722
Preprocssed file to reproduce bug

Data flow analysis in variable tracking does not converge and causes an infinite loop with the attached file and following compile options:

./cc1plus -quiet -fpreprocessed qmltextgenerator.ii -dumpbase qmltextgenerator.ii -march=armv4t -mfloat-abi=soft -mtls-dialect=gnu -auxbase-strip x.o -g -O2 -Wformat=1 -Werror=format-security -Wall -Wextra -version -fstack-protector -fvisibility=hidden -fvisibility-inlines-hidden -fPIC --param ssp-buffer-size=4 -o qmltextgenerator.s

GCC configured with --target=arm-linux-gnueabi

Revision history for this message
In , Ktkachov (ktkachov) wrote :

Confirmed with arm-none-eabi as well.

Revision history for this message
In , Mkuvyrkov (mkuvyrkov) wrote :

Assigned to myself as Michael does not have a GCC developer account yet. Michael is the one working on this bug.

Revision history for this message
In , Doko-v (doko-v) wrote :

Created attachment 33243
test case

seen on the 4.8 and 4.9 branch, cc1plus doesn't terminate. omitting the -g lets the command succeed.

$ g++ -v -std=c++0x -c -g -O2 qmltextgenerator.cpp

Program received signal SIGINT, Interrupt.
0x0054920c in canonicalize_values_star(variable_def**, dataflow_set_def*) ()
(gdb) bt
#0 0x0054920c in canonicalize_values_star(variable_def**, dataflow_set_def*)
    ()
#1 0x0054b0c2 in ?? ()
#2 0x0054ca08 in ?? ()
#3 0x0054d8ba in ?? ()
#4 0x0039928a in execute_one_pass(opt_pass*) ()
#5 0x00399448 in execute_pass_list(opt_pass*) ()
#6 0x00399452 in execute_pass_list(opt_pass*) ()
#7 0x00399452 in execute_pass_list(opt_pass*) ()
#8 0x00244a8c in ?? ()
#9 0x00245ca4 in compile() ()
#10 0x00246030 in finalize_compilation_unit() ()
#11 0x00158fc4 in cp_write_global_declarations() ()
#12 0x00409394 in ?? ()
#13 0x0040aad0 in toplev_main(int, char**) ()
#14 0xb6d4f630 in __libc_start_main (main=0x111e19 <main>, argc=26,
    argv=0xbefff604, init=<optimized out>, fini=0x7b2af5 <__libc_csu_fini>,
    rtld_fini=0xb6fe24e5 <_dl_fini>, stack_end=0xbefff604) at libc-start.c:287
#15 0x00112058 in _start ()

defaults are -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb

Revision history for this message
In , Ktkachov (ktkachov) wrote :

I'm willing to bet this is a duplicate of 61033 that also involves a qmltextgenerator.ii preprocessed reproducer file ;)

It goes into an infinite loop for me on arm-none-eabi with 4.9 and passes with current trunk. Didn't try 4.8, I expect it fails there like you say.

I don't remember if it was fixed in trunk and the fix not backported or just made latent.

*** This bug has been marked as a duplicate of bug 61033 ***

Revision history for this message
In , Ktkachov (ktkachov) wrote :

*** Bug 62013 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Ktkachov (ktkachov) wrote :

Filling in some fields, this still fails on the 4.8 and 4.9 branches but works on trunk.

Changed in gcc-4.9 (Debian):
status: Unknown → New
Changed in gcc:
importance: Unknown → Medium
status: Unknown → Invalid
Revision history for this message
In , Cbaylis-u (cbaylis-u) wrote :

Created attachment 33244
Reduced test case

$ arm-unknown-linux-gnueabihf-gcc -S -O2 -g reduced1.cpp

Revision history for this message
In , Cbaylis-u (cbaylis-u) wrote :

git bisect points to r211625 as the revision which fixes/hides this bug on trunk.

2014-06-13 Richard Biener <email address hidden>

        * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
        Rewrite to propagate the VN result into all uses where
        possible and to remove stmts becoming dead because of that.
        (eliminate): Generalize stmt removal handling, remove in
        reverse dominator order to support proper debug stmt
        generation. Update stmts before removing stmts.
        * tree-ssa-propagate.c (propagate_tree_value): Remove
        bogus assert.

Revision history for this message
In , Michael Collison (michael-collison) wrote :

Charlie,

I still feel that the var tracking pass should be able to protect itself
from an infinite loop.

On 8/4/2014 11:43 AM, cbaylis at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61033
>
> --- Comment #6 from cbaylis at gcc dot gnu.org ---
>
> git bisect points to r211625 as the revision which fixes/hides this bug on
> trunk.
>
> 2014-06-13 Richard Biener <email address hidden>
>
> * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
> Rewrite to propagate the VN result into all uses where
> possible and to remove stmts becoming dead because of that.
> (eliminate): Generalize stmt removal handling, remove in
> reverse dominator order to support proper debug stmt
> generation. Update stmts before removing stmts.
> * tree-ssa-propagate.c (propagate_tree_value): Remove
> bogus assert.
>

Matthias Klose (doko)
summary: - [4.8/4.9 Regresion] cc1plus doesn't terminate when called with -g on
+ [4.8/4.9 Regression] cc1plus doesn't terminate when called with -g on
arm-linux-gnueabihf
Changed in gcc-4.9 (Debian):
status: New → Confirmed
Matthias Klose (doko)
Changed in gcc:
importance: Medium → Unknown
status: Invalid → Unknown
Changed in gcc:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , dcb (dcb314) wrote :

Created attachment 33361
C++ source code

Revision history for this message
In , dcb (dcb314) wrote :

(In reply to David Binderman from comment #8)
> Created attachment 33361 [details]
> C++ source code

Please ignore this attachment. It is for a different bug.

Revision history for this message
In , Mkuvyrkov (mkuvyrkov) wrote :

Michael,

What is the status of this bug?

Thanks.

Revision history for this message
In , Jakub-gcc (jakub-gcc) wrote :

GCC 4.8.4 has been released.

Changed in gcc-4.9 (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.