public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/100042] New: ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer
@ 2021-04-12  9:19 acoplan at gcc dot gnu.org
  2021-04-13  1:36 ` [Bug analyzer/100042] " dmalcolm at gcc dot gnu.org
  2021-04-13  9:09 ` acoplan at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-04-12  9:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100042
           Summary: ICE in gimple_call_set_fndecl with -Os
                    -fsanitize=undefined -flto -fanalyzer
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

Possibly a dup of PR98599, thought it might be worth reporting in any case:

$ cat test.cc
long *a;
void b(unsigned) { *a ^= 9 + *a >> 2; }
int c;
void d() { b(c); }
int main() { d(); }
$ aarch64-linux-gnu-gcc -Os -fsanitize=undefined -flto -fanalyzer test.cc
test.cc: In function ‘b’:
test.cc:2:30: warning: dereference of NULL ‘0B’ [CWE-476]
[-Wanalyzer-null-dereference]
    2 | void b(unsigned) { *a ^= 9 + *a >> 2; }
      |                              ^
  ‘main’: events 1-2
    |
    |    5 | int main() { d(); }
    |      |     ^         ~
    |      |     |         |
    |      |     |         (2) calling ‘d’ from ‘main’
    |      |     (1) entry to ‘main’
    |
    +--> ‘d’: events 3-4
           |
           |    4 | void d() { b(c); }
           |      |      ^      ~
           |      |      |      |
           |      |      |      (4) calling ‘b’ from ‘d’
           |      |      (3) entry to ‘d’
           |
           +--> ‘b’: events 5-6
                  |
                  |    2 | void b(unsigned) { *a ^= 9 + *a >> 2; }
                  |      |      ^                       ~
                  |      |      |                       |
                  |      |      |                       (6) dereference of NULL
‘a’
                  |      |      (5) entry to ‘b’
                  |
during IPA pass: inline
test.cc: In function ‘main’:
test.cc:4:13: internal compiler error: in gimple_call_set_fndecl, at
gimple.h:3135
    4 | void d() { b(c); }
      |             ^
0x7cc398 gimple_call_set_fndecl
        /home/alecop01/toolchain/src/gcc/gcc/gimple.h:3135
0x7cc398 cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*)
        /home/alecop01/toolchain/src/gcc/gcc/cgraph.c:1568
0xd731e0 redirect_all_calls(copy_body_data*, basic_block_def*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:2962
0xd77f0e copy_cfg_body
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:3117
0xd77f0e copy_body
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:3300
0xd7b1ff expand_call_inline
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:5123
0xd7c53a gimple_expand_calls_inline
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:5313
0xd7c53a optimize_inline_calls(tree_node*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-inline.c:5486
0xa4fbb5 inline_transform(cgraph_node*)
        /home/alecop01/toolchain/src/gcc/gcc/ipa-inline-transform.c:790
0xbd2e61 execute_one_ipa_transform_pass
        /home/alecop01/toolchain/src/gcc/gcc/passes.c:2290
0xbd2e61 execute_all_ipa_transforms(bool)
        /home/alecop01/toolchain/src/gcc/gcc/passes.c:2337
0x7d357a cgraph_node::expand()
        /home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:1823
0x7d54b2 expand_all_functions
        /home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:1994
0x7d54b2 symbol_table::compile()
        /home/alecop01/toolchain/src/gcc/gcc/cgraphunit.c:2358
0x6eec23 lto_main()
        /home/alecop01/toolchain/src/gcc/gcc/lto/lto.c:653
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: aarch64-linux-gnu-gcc returned 1 exit status
compilation terminated.
/home/alecop01/toolchain/build-aarch64-linux-gnu/install/bin/../lib/gcc/aarch64-linux-gnu/11.0.1/../../../../aarch64-linux-gnu/bin/ld:
error: lto-wrapper failed
collect2: error: ld returned 1 exit status

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

* [Bug analyzer/100042] ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer
  2021-04-12  9:19 [Bug analyzer/100042] New: ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer acoplan at gcc dot gnu.org
@ 2021-04-13  1:36 ` dmalcolm at gcc dot gnu.org
  2021-04-13  9:09 ` acoplan at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2021-04-13  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
I'm not able to reproduce this, but I just committed a fix for PR 98599; does
that fix this for you also?

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

* [Bug analyzer/100042] ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer
  2021-04-12  9:19 [Bug analyzer/100042] New: ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer acoplan at gcc dot gnu.org
  2021-04-13  1:36 ` [Bug analyzer/100042] " dmalcolm at gcc dot gnu.org
@ 2021-04-13  9:09 ` acoplan at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-04-13  9:09 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Yes, I'm no longer seeing it now. Thanks

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

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

end of thread, other threads:[~2021-04-13  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  9:19 [Bug analyzer/100042] New: ICE in gimple_call_set_fndecl with -Os -fsanitize=undefined -flto -fanalyzer acoplan at gcc dot gnu.org
2021-04-13  1:36 ` [Bug analyzer/100042] " dmalcolm at gcc dot gnu.org
2021-04-13  9:09 ` acoplan 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).