* [Bug c/99340] [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
@ 2021-03-02 12:10 ` marxin at gcc dot gnu.org
2021-03-02 12:36 ` [Bug c/99340] " rguenth at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-02 12:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org
Last reconfirmed| |2021-03-02
Status|UNCONFIRMED |WAITING
Ever confirmed|0 |1
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
I see the warning (with -fPIE) for all releases I have (4.8.0+).
But yes, -fPIC does not report the warning.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
2021-03-02 12:10 ` [Bug c/99340] " marxin at gcc dot gnu.org
@ 2021-03-02 12:36 ` rguenth at gcc dot gnu.org
2021-03-02 12:46 ` doko at debian dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-02 12:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
PIC allows interposing ags_midi_buffer_util_get_varlength and thus possibly
initializing the argument. PIE does not allow this so we see it is not
initialized.
I suppose the change on the branch is for some unreduced testcase where
different optimization might trigger the new warning (correctly I think).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
2021-03-02 12:10 ` [Bug c/99340] " marxin at gcc dot gnu.org
2021-03-02 12:36 ` [Bug c/99340] " rguenth at gcc dot gnu.org
@ 2021-03-02 12:46 ` doko at debian dot org
2021-03-02 12:51 ` marxin at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: doko at debian dot org @ 2021-03-02 12:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
--- Comment #3 from Matthias Klose <doko at debian dot org> ---
Created attachment 50284
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50284&action=edit
preprocessed source
original test case before reducing
gcc -std=gnu99 -Werror=uninitialized -Werror=maybe-uninitialized -Wall
-Wno-unused-variable -Wno-unused-but-set-variable -Wformat -Wno-pointer-sign
-Werror=format-security -fstack-protector-strong -fPIC -O2 -c
ags_midi_buffer_util_orig.i
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
` (2 preceding siblings ...)
2021-03-02 12:46 ` doko at debian dot org
@ 2021-03-02 12:51 ` marxin at gcc dot gnu.org
2021-03-02 13:05 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-02 12:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Matthias Klose from comment #3)
> Created attachment 50284 [details]
> preprocessed source
>
> original test case before reducing
>
> gcc -std=gnu99 -Werror=uninitialized -Werror=maybe-uninitialized -Wall
> -Wno-unused-variable -Wno-unused-but-set-variable -Wformat -Wno-pointer-sign
> -Werror=format-security -fstack-protector-strong -fPIC -O2 -c
> ags_midi_buffer_util_orig.i
Using this with -fPIE reports the warning only on gcc-10 branch. All other is
fine.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
` (3 preceding siblings ...)
2021-03-02 12:51 ` marxin at gcc dot gnu.org
@ 2021-03-02 13:05 ` marxin at gcc dot gnu.org
2021-03-02 13:45 ` rguenth at gcc dot gnu.org
2021-04-12 19:28 ` msebor at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-02 13:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
CC| |rguenth at gcc dot gnu.org
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Started on gcc-10 branch with g:eddcb627ccfbd97e025cf366cc3f3bad76211785.
Anyway, the warning contains quite some false positives..
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
` (4 preceding siblings ...)
2021-03-02 13:05 ` marxin at gcc dot gnu.org
@ 2021-03-02 13:45 ` rguenth at gcc dot gnu.org
2021-04-12 19:28 ` msebor at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-02 13:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 warns as well. I think this was a false negative which is now fixed.
Note GCC 10.1.0 and GCC 10.2.0 warn for me as well, so something must have
regressed this between 10.2.0 and g:eddcb627ccfbd97e025cf366
I'm inclined to mark as INVALID.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/99340] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC
2021-03-02 12:04 [Bug c/99340] New: [10/11 Regression] -Werror=maybe-uninitialized warning with -fPIE, but not -fPIC doko at debian dot org
` (5 preceding siblings ...)
2021-03-02 13:45 ` rguenth at gcc dot gnu.org
@ 2021-04-12 19:28 ` msebor at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-12 19:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99340
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
CC| |msebor at gcc dot gnu.org
Keywords| |diagnostic
Blocks| |24639
--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
The IL with -fPIC shows a call to ags_midi_buffer_util_get_varlength() while
the IL with -fPIE has the call expanded inline, which is what less the warning
see current_delta_time is not initialized. With that, resolving as invalid
per c6.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues
^ permalink raw reply [flat|nested] 8+ messages in thread