public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options
@ 2015-03-09 21:43 mike at cchtml dot com
  2015-03-10  6:30 ` [Bug sanitizer/65367] [5 Regression] " trippels at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mike at cchtml dot com @ 2015-03-09 21:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

            Bug ID: 65367
           Summary: indefinite loop occurs with sanitize enabled and
                    certain optimization options
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mike at cchtml dot com

Created attachment 34997
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34997&action=edit
makedep.pp

When attempting to debug a gcc5/wine issue I ran across an infinite loop when
certain optimization flags are set. The "tools/makedep.c" program during wine's
autotools configure process is where the issue is occurring.

Compile the attached pre-processed code with the following:

gcc -x cpp-output ./makedep.pp -mtune=generic -march=x86-64 -O1
-fsanitize=undefined -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dominator-opts
-fno-tree-fre -o makedep.o

The loop only occurs when -O1 is specified (doesn't happen with -O2+) and all
four tree optimizations are disabled simultaneously. If any are enabled it does
not loop. If sanitize is disabled it does not loop. GCC 4.9 compiles the code
without looping.

$ gcc --version
gcc (GCC) 5.0.0 20150226 (Red Hat 5.0.0-0.18)


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

* [Bug sanitizer/65367] [5 Regression] indefinite loop occurs with sanitize enabled and certain optimization options
  2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
@ 2015-03-10  6:30 ` trippels at gcc dot gnu.org
  2015-03-10  8:47 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-03-10  6:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-10
                 CC|                            |dodji at gcc dot gnu.org,
                   |                            |dvyukov at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org,
                   |                            |kcc at gcc dot gnu.org,
                   |                            |trippels at gcc dot gnu.org
          Component|middle-end                  |sanitizer
   Target Milestone|---                         |5.0
            Summary|indefinite loop occurs with |[5 Regression] indefinite
                   |sanitize enabled and        |loop occurs with sanitize
                   |certain optimization        |enabled and certain
                   |options                     |optimization options
     Ever confirmed|0                           |1


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

* [Bug sanitizer/65367] [5 Regression] indefinite loop occurs with sanitize enabled and certain optimization options
  2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
  2015-03-10  6:30 ` [Bug sanitizer/65367] [5 Regression] " trippels at gcc dot gnu.org
@ 2015-03-10  8:47 ` mpolacek at gcc dot gnu.org
  2015-03-10  9:00 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-10  8:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like to be caused by -fsanitize=object-size, i.e. we hit some looping in
ubsan_expand_objsize_ifn:

$ gstack 23098
#0  0x00000000008084a9 in gimple_code (g=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/gimple.h:1553
#1  0x0000000000808657 in gimple_has_mem_ops (g=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/gimple.h:1870
#2  0x000000000081eb06 in is_a_helper<gimple_statement_with_memory_ops
const*>::test<gimple_statement_base const> (gs=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/gimple.h:1878
#3  0x000000000081fad6 in is_a<gimple_statement_with_memory_ops const*,
gimple_statement_base const> (p=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/is-a.h:182
#4  0x000000000081ed66 in dyn_cast<gimple_statement_with_memory_ops const*,
gimple_statement_base const> (p=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/is-a.h:219
#5  0x0000000000ef7097 in gimple_vuse (g=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/gimple.h:1919
#6  0x0000000000efae9e in unlink_stmt_vdef (stmt=0x7f3c99fc9dc8) at
/home/marek/src/gcc/gcc/tree-ssa-operands.c:1311
#7  0x0000000000d62b48 in ubsan_expand_objsize_ifn (gsi=0x7fff594715f0) at
/home/marek/src/gcc/gcc/ubsan.c:1028
#8  0x0000000000d69f08 in (anonymous namespace)::pass_sanopt::execute
(this=0x2ad1d00, fun=0x7f3c99cfaa80) at /home/marek/src/gcc/gcc/sanopt.c:741
#9  0x0000000000c41985 in execute_one_pass (pass=0x2ad1d00) at
/home/marek/src/gcc/gcc/passes.c:2328
#10 0x0000000000c41bbf in execute_pass_list_1 (pass=0x2ad1d00) at
/home/marek/src/gcc/gcc/passes.c:2380
#11 0x0000000000c41c2d in execute_pass_list (fn=0x7f3c99cfaa80, pass=0x2acedc0)
at /home/marek/src/gcc/gcc/passes.c:2391
#12 0x000000000085e4a0 in cgraph_node::expand (this=0x7f3c99d03310) at
/home/marek/src/gcc/gcc/cgraphunit.c:1878
#13 0x000000000085ead4 in expand_all_functions () at
/home/marek/src/gcc/gcc/cgraphunit.c:2014
#14 0x000000000085f5ec in symbol_table::compile (this=0x7f3c99e2e000) at
/home/marek/src/gcc/gcc/cgraphunit.c:2367
#15 0x000000000085f798 in symbol_table::finalize_compilation_unit
(this=0x7f3c99e2e000) at /home/marek/src/gcc/gcc/cgraphunit.c:2444
#16 0x00000000006be04e in c_write_global_declarations () at
/home/marek/src/gcc/gcc/c/c-decl.c:10800
#17 0x0000000000d38ea3 in compile_file () at
/home/marek/src/gcc/gcc/toplev.c:608
#18 0x0000000000d3b32d in do_compile () at
/home/marek/src/gcc/gcc/toplev.c:2066
#19 0x0000000000d3b55b in toplev::main (this=0x7fff59471890, argc=9,
argv=0x7fff59471998) at /home/marek/src/gcc/gcc/toplev.c:2164
#20 0x0000000000698daa in main (argc=9, argv=0x7fff59471998) at
/home/marek/src/gcc/gcc/main.c:39


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

* [Bug sanitizer/65367] [5 Regression] indefinite loop occurs with sanitize enabled and certain optimization options
  2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
  2015-03-10  6:30 ` [Bug sanitizer/65367] [5 Regression] " trippels at gcc dot gnu.org
  2015-03-10  8:47 ` mpolacek at gcc dot gnu.org
@ 2015-03-10  9:00 ` rguenth at gcc dot gnu.org
  2015-03-10 12:55 ` mpolacek at gcc dot gnu.org
  2015-03-10 15:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-10  9:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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

* [Bug sanitizer/65367] [5 Regression] indefinite loop occurs with sanitize enabled and certain optimization options
  2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
                   ` (2 preceding siblings ...)
  2015-03-10  9:00 ` rguenth at gcc dot gnu.org
@ 2015-03-10 12:55 ` mpolacek at gcc dot gnu.org
  2015-03-10 15:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-10 12:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Reduced:

int
foo (char *p)
{
  return *((const char *) "") - *p;
}


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

* [Bug sanitizer/65367] [5 Regression] indefinite loop occurs with sanitize enabled and certain optimization options
  2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
                   ` (3 preceding siblings ...)
  2015-03-10 12:55 ` mpolacek at gcc dot gnu.org
@ 2015-03-10 15:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-10 15:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65367

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed, thanks for the report.


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

end of thread, other threads:[~2015-03-10 15:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 21:43 [Bug c/65367] New: indefinite loop occurs with sanitize enabled and certain optimization options mike at cchtml dot com
2015-03-10  6:30 ` [Bug sanitizer/65367] [5 Regression] " trippels at gcc dot gnu.org
2015-03-10  8:47 ` mpolacek at gcc dot gnu.org
2015-03-10  9:00 ` rguenth at gcc dot gnu.org
2015-03-10 12:55 ` mpolacek at gcc dot gnu.org
2015-03-10 15:59 ` mpolacek 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).