public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
@ 2020-05-08  8:22 ` dcb314 at hotmail dot com
  2020-08-14  3:40 ` asolokha at gmx dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-05-08  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #11)
> (In reply to David Binderman from comment #9)
> > I'll report back with anything else I find.
> 
> 154 ice left. 

I had another look at this and considerable progress has been made.
Only six ices left for the C code in the test suite. These are

$ egrep "internal compiler error:" 20200508.c.out | fgrep analyzer | sort -k 2 
./gcc.c-torture/compile/20010107-1.c:7:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6932
./gcc.target/i386/addr-space-5.c:13:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6932
./c-c++-common/vector-subscript-3.c:5:16: internal compiler error: in validate,
at analyzer/region-model.cc:243
./gcc.dg/pr70022.c:9:3: internal compiler error: in validate, at
analyzer/region-model.cc:243
./gcc.dg/pr78526.c:10:1: internal compiler error: in validate, at
analyzer/region-model.cc:243
./gcc.target/i386/pr79498.c:9:1: internal compiler error: in validate, at
analyzer/region-model.cc:243
$ 

I used compiler flags -g -O2 -fanalyzer.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
  2020-05-08  8:22 ` [Bug analyzer/93388] ensure -fanalyzer works with our C code dcb314 at hotmail dot com
@ 2020-08-14  3:40 ` asolokha at gmx dot com
  2020-08-14  9:00 ` dcb314 at hotmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: asolokha at gmx dot com @ 2020-08-14  3:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to David Binderman from comment #16)
> I had another look at this and considerable progress has been made.
> Only six ices left for the C code in the test suite. These are

After the recent analyzer overhaul it's probably time to update this list once
again. Maybe trying each optimization level in turn besides -O2 might also make
sense.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
  2020-05-08  8:22 ` [Bug analyzer/93388] ensure -fanalyzer works with our C code dcb314 at hotmail dot com
  2020-08-14  3:40 ` asolokha at gmx dot com
@ 2020-08-14  9:00 ` dcb314 at hotmail dot com
  2020-08-14 18:42 ` dcb314 at hotmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-08-14  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Arseny Solokha from comment #17)
> After the recent analyzer overhaul it's probably time to update this list
> once again. 

Done. 

$ cat 20200814.ana.O2.c.out | fgrep "internal c" | fgrep analyzer
./c-c++-common/vector-subscript-3.c:5:16: internal compiler error: in validate,
at analyzer/region-model.cc:243
./gcc.c-torture/compile/20010107-1.c:7:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6932
./gcc.dg/pr70022.c:9:3: internal compiler error: in validate, at
analyzer/region-model.cc:243
./gcc.dg/pr78526.c:10:1: internal compiler error: in validate, at
analyzer/region-model.cc:243
./gcc.target/i386/addr-space-5.c:13:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6932
./gcc.target/i386/pr79498.c:9:1: internal compiler error: in validate, at
analyzer/region-model.cc:243
$

So downto two crashes. I used flags -g -O2 -fanalyzer

> Maybe trying each optimization level in turn besides -O2 might
> also make sense.

Maybe. One thing at a time. Let's get popular flags like -g -O2 working first.

Then maybe -g -O3 then -g -O3 -march=native. Then when that's all working
we can try out -fanalyzer on the source code of gcc. Just some ideas.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-08-14  9:00 ` dcb314 at hotmail dot com
@ 2020-08-14 18:42 ` dcb314 at hotmail dot com
  2020-09-28 10:20 ` asolokha at gmx dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-08-14 18:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from David Binderman <dcb314 at hotmail dot com> ---
I tried out the C++ code with -g -O2 -fanalyzer and got the following:

$ cat 20200814.ana.O2.cpp.out | fgrep "internal c" | fgrep analyzer
./g++.dg/expr/ptrmem7.C:20:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6938
./g++.dg/expr/ptrmem8.C:13:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6938
./g++.old-deja/g++.bugs/900212_03.C:28:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6938
./g++.old-deja/g++.law/code-gen4.C:24:9: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6938
./g++.old-deja/g++.mike/pmf1.C:36:3: internal compiler error: in
get_or_create_mem_ref, at analyzer/region-model.cc:6938
$

So only one crash, different to the C code, there.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-08-14 18:42 ` dcb314 at hotmail dot com
@ 2020-09-28 10:20 ` asolokha at gmx dot com
  2020-09-28 10:42 ` dcb314 at hotmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: asolokha at gmx dot com @ 2020-09-28 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Arseny Solokha <asolokha at gmx dot com> ---
Using gcc-11.0.0-alpha20200927 snapshot I've just managed to build current
Linux master, configured w/ allyesconfig for x86_64, without ICEs, compile-time
hogs, or memory hogs in the analyzer for the first time. That's quite a
milestone.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-09-28 10:20 ` asolokha at gmx dot com
@ 2020-09-28 10:42 ` dcb314 at hotmail dot com
  2020-09-28 11:03 ` asolokha at gmx dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-09-28 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from David Binderman <dcb314 at hotmail dot com> ---
So given that the analyzer doesn't crash on the current Linux kernel code,
does it do anything useful like find any bugs, perhaps ?

Maybe gcc compiling itself with the analyzer might find some bugs, too.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2020-09-28 10:42 ` dcb314 at hotmail dot com
@ 2020-09-28 11:03 ` asolokha at gmx dot com
  2020-10-14 20:39 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: asolokha at gmx dot com @ 2020-09-28 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to David Binderman from comment #21)
> So given that the analyzer doesn't crash on the current Linux kernel code,
> does it do anything useful like find any bugs, perhaps ?

The snapshot I've mentioned is the first one ever which has gotten to be able
to build whole allyesconfig Linux w/ -fanalyzer w/o any ICE. I didn't try to
check its reports on Linux up until now. Analyzer still has some issues like
the one I reported in PR93695 which constitutes a heavy dose of false positives
in my testing.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2020-09-28 11:03 ` asolokha at gmx dot com
@ 2020-10-14 20:39 ` cvs-commit at gcc dot gnu.org
  2020-10-14 20:57 ` dmalcolm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-14 20:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:

https://gcc.gnu.org/g:61a43de58cb6de7212a622060500ad0a0fd94fae

commit r11-3896-g61a43de58cb6de7212a622060500ad0a0fd94fae
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Oct 13 18:49:11 2020 -0400

    analyzer: fix ICE on globals with unknown size [PR93388]

    This patch fixes an ICE seen when attempting to build various existing
    tests in our testsuite with -fanalyzer, including
    gcc.c-torture/compile/980816-1.c.

    gcc/analyzer/ChangeLog:
            PR analyzer/93388
            * region-model.cc (region_model::get_initial_value_for_global):
            Fall back to returning an initial_svalue if
            decl_region::get_svalue_for_initializer fails.
            * region.cc (decl_region::get_svalue_for_initializer): Don't
            attempt to create a compound_svalue if the region has an unknown
            size.

    gcc/testsuite/ChangeLog:
            PR analyzer/93388
            * gcc.dg/analyzer/data-model-21.c: New test.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2020-10-14 20:39 ` cvs-commit at gcc dot gnu.org
@ 2020-10-14 20:57 ` dmalcolm at gcc dot gnu.org
  2020-10-14 21:05 ` dmalcolm at gcc dot gnu.org
  2020-10-14 21:34 ` dcb314 at hotmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-14 20:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93388
Bug 93388 depends on bug 93723, which changed state.

Bug 93723 Summary: ICEs building ada with -fanalyzer
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93723

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

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2020-10-14 20:57 ` dmalcolm at gcc dot gnu.org
@ 2020-10-14 21:05 ` dmalcolm at gcc dot gnu.org
  2020-10-14 21:34 ` dcb314 at hotmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-10-14 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
As noted in https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556203.html
I was able to bootstrap using the method described in comment #0, albeit taking
7 hours (compared to the 45 minutes it normally takes on this machine).

So the bug as originally reported is fixed - but I need to double-check that
there aren't any ICEs when compiling the testsuite files with -fanalyzer (as
per comment #9, comment #12 etc); comment #23 was one I saw on a partial test
run of this.

Also, arguably there are scaling issues to be addressed - some source files
took an hour to compile with -fanalyzer during the bootstrap.

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

* [Bug analyzer/93388] ensure -fanalyzer works with our C code
       [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2020-10-14 21:05 ` dmalcolm at gcc dot gnu.org
@ 2020-10-14 21:34 ` dcb314 at hotmail dot com
  10 siblings, 0 replies; 11+ messages in thread
From: dcb314 at hotmail dot com @ 2020-10-14 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #21)
> Maybe gcc compiling itself with the analyzer might find some bugs, too.

I tried this and all I found were AFAIK false positives.

Perhaps someone with more knowledge of the analyzer could reproduce
this and confirm what I think I am seeing.

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

end of thread, other threads:[~2020-10-14 21:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93388-4@http.gcc.gnu.org/bugzilla/>
2020-05-08  8:22 ` [Bug analyzer/93388] ensure -fanalyzer works with our C code dcb314 at hotmail dot com
2020-08-14  3:40 ` asolokha at gmx dot com
2020-08-14  9:00 ` dcb314 at hotmail dot com
2020-08-14 18:42 ` dcb314 at hotmail dot com
2020-09-28 10:20 ` asolokha at gmx dot com
2020-09-28 10:42 ` dcb314 at hotmail dot com
2020-09-28 11:03 ` asolokha at gmx dot com
2020-10-14 20:39 ` cvs-commit at gcc dot gnu.org
2020-10-14 20:57 ` dmalcolm at gcc dot gnu.org
2020-10-14 21:05 ` dmalcolm at gcc dot gnu.org
2020-10-14 21:34 ` dcb314 at hotmail dot com

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).