public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/94689] New: arrays of functions are not meaningful
@ 2020-04-21 12:24 pmatos at gcc dot gnu.org
  2020-04-21 12:37 ` [Bug analyzer/94689] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pmatos at gcc dot gnu.org @ 2020-04-21 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94689
           Summary: arrays of functions are not meaningful
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: pmatos at gcc dot gnu.org
  Target Milestone: ---

With head of git from today (2020.04.21), gcc with -fanalyzer return non-zero
exit code for

///
*a;
b;
c() { d((void (*)())a + b); }

///


using the command line:
gcc -O2 -g -fanalyzer  -Wall   -I./.. -I./../include -I./../../rktio
-I../../rktio -pthread -I/usr/lib64/libffi/include   -DUSE_SENORA_GC    -c
foreign.i -o foreign.o

yet, if you remove the -fanalyzer flag it returns exit code 0.

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
@ 2020-04-21 12:37 ` redi at gcc dot gnu.org
  2020-04-21 12:42 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-04-21 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Version|unknown                     |10.0
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-04-21
           Keywords|                            |rejects-valid

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Most of the command line is irrelevant to the bug, only -fanalyzer is needed.

I'm setting the rejects-valid keyword, even though the code actually has a
pedwarn and depends on a GNU extension.

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
  2020-04-21 12:37 ` [Bug analyzer/94689] " redi at gcc dot gnu.org
@ 2020-04-21 12:42 ` jakub at gcc dot gnu.org
  2020-04-21 12:46 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-21 12:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly cleaned up testcase (still, pedantically invalid):

typedef void (*F) (void);
void bar (F);

void
foo (void *a, int b)
{
  bar ((F) a + b);
}

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
  2020-04-21 12:37 ` [Bug analyzer/94689] " redi at gcc dot gnu.org
  2020-04-21 12:42 ` jakub at gcc dot gnu.org
@ 2020-04-21 12:46 ` jakub at gcc dot gnu.org
  2020-05-12 11:01 ` pmatos at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-21 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Guess get_or_create_mem_ref should punt or do something else for pointers to
functions, trying to create an ARRAY_TYPE of FUNCTION_TYPE (or METHOD_TYPE) is
rejected by build_array_type.

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-04-21 12:46 ` jakub at gcc dot gnu.org
@ 2020-05-12 11:01 ` pmatos at gcc dot gnu.org
  2020-08-13 20:33 ` dmalcolm at gcc dot gnu.org
  2020-08-13 21:13 ` pmatos at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pmatos at gcc dot gnu.org @ 2020-05-12 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from pmatos at gcc dot gnu.org ---
Unfortunately a fix for this didn't make it into 10.1. We can still not analyze
racket source code due to this issue.

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-05-12 11:01 ` pmatos at gcc dot gnu.org
@ 2020-08-13 20:33 ` dmalcolm at gcc dot gnu.org
  2020-08-13 21:13 ` pmatos at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2020-08-13 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

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

--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
The bogus "arrays of functions are not meaningful" error from -fanalyzer should
be fixed by g:808f4dfeb3a95f50f15e71148e5c1067f90a126d (for GCC 11).  Marking
this as fixed.

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

* [Bug analyzer/94689] arrays of functions are not meaningful
  2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-08-13 20:33 ` dmalcolm at gcc dot gnu.org
@ 2020-08-13 21:13 ` pmatos at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pmatos at gcc dot gnu.org @ 2020-08-13 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from pmatos at gcc dot gnu.org ---
Thanks - I will rerun the static analyzer on the codebase that previously
crashed the static analyzer and report back.

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

end of thread, other threads:[~2020-08-13 21:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 12:24 [Bug analyzer/94689] New: arrays of functions are not meaningful pmatos at gcc dot gnu.org
2020-04-21 12:37 ` [Bug analyzer/94689] " redi at gcc dot gnu.org
2020-04-21 12:42 ` jakub at gcc dot gnu.org
2020-04-21 12:46 ` jakub at gcc dot gnu.org
2020-05-12 11:01 ` pmatos at gcc dot gnu.org
2020-08-13 20:33 ` dmalcolm at gcc dot gnu.org
2020-08-13 21:13 ` pmatos 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).