[Bug analyzer/109580] New: #pragma GCC diagnostic ignored "-Wanalyzer-fd-leak" is ineffective

2023-04-20 Thread eggert at gnu dot org via Gcc-bugs
ty: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 54896 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54896&action=edit compressed test pro

[Bug analyzer/109579] New: -Wanalyzer-out-of-bounds false positive in Emacs mapping stack

2023-04-20 Thread eggert at gnu dot org via Gcc-bugs
Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 54895 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54895&action=edit compressed test program illustratin

[Bug analyzer/109577] New: -Wanalyzer-allocation-size mishandles __builtin_mul_overflow

2023-04-20 Thread eggert at gnu dot org via Gcc-bugs
Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- This is (GCC) 13.0.1 20230401 (Red Hat 13.0.1-0) on x86-64. Compile the following program with 'gcc -O2 -S -fanalyzer t.c'

[Bug c/108690] New: -Wstrict-prototypes too picky for C23

2023-02-06 Thread eggert at gnu dot org via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- We ran into this problem in Gnulib when considering how to migrate towards C23. With GCC 12.2.1 20221121 (Red Hat 12.2.1-4) on x86-64, compile the following one-line program t.c with

[Bug c/101682] gcc incorrectly rejects C2x attributes after declaration-specifiers

2021-07-30 Thread eggert at gnu dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101682 Paul Eggert changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/101682] gcc incorrectly rejects C2x attributes after declaration-specifiers

2021-07-29 Thread eggert at gnu dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101682 --- Comment #2 from Paul Eggert --- Clang's warnings are not a problem here, because in clang 12.0.0 (the current release) __has_c_attribute(nodiscard) is false, so code like this works: #ifndef __has_c_attribute # define __has_c_attribute(x) 0

[Bug c/101682] New: gcc incorrectly rejects C2x attributes after declaration-specifiers

2021-07-29 Thread eggert at gnu dot org via Gcc-bugs
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- The grammar at the start of section 6.7 of the current C2x draft (N2596) says that attribute specifiers may appear either before or after

[Bug other/100735] New: -fno-trampolines doc wrongly implies it affects C, C++ etc.

2021-05-23 Thread eggert at gnu dot org via Gcc-bugs
Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 50859 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50859&action=edit doc patch for -fno-trampolines confusi

[Bug target/99591] New: Improving __builtin_add_overflow performance on x86-64

2021-03-15 Thread eggert at gnu dot org via Gcc-bugs
Component: target Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- This is with gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9) on x86-64. For the function: _Bool signed1_overflow (signed char a, signed char b) { signed char r

[Bug c/97370] comedy of boolean errors for '!a & (b|c)'

2020-10-12 Thread eggert at gnu dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97370 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #4 from

[Bug debug/80646] [8/9/10 Regression] wrong type info for extern inline function when compiling Emacs

2019-11-14 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80646 Paul Eggert changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2019-03-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Version|7.1.1 |8.3.1 --- Comment #10 from Paul Eggert --

[Bug middle-end/85563] [8/9 regression] -Wmaybe-uninitialized false alarm regression with __builtin_unreachable and GCC 8

2019-02-01 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85563 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #8 from

[Bug c/71157] -Wnull-dereference false alarm in wrong function

2018-09-16 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71157 --- Comment #9 from Paul Eggert --- (In reply to Eric Gallager from comment #8) > Try marking it up with __attribute__((returns_nonnull)) and/or > __attribute__((nonnull)). If the first one works, then it's a case where GCC > should suggest it,

[Bug tree-optimization/81401] False positive sprintf warning at O2 (-Wformat-overflow)

2018-05-30 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81401 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #3 from

[Bug middle-end/85602] -Wsizeof-pointer-memaccess for strncat with size of source

2018-05-14 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85602 --- Comment #4 from Paul Eggert --- Thanks, that workaround is much better for coreutils, and I installed it here: https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=f6cb50cc991d461f443ea3afc517c9e1e37ef496

[Bug middle-end/85602] -Wsizeof-pointer-memaccess for strncat with size of source

2018-05-14 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85602 --- Comment #2 from Paul Eggert --- Thanks for looking into it. For what it's worth, the practical effect of this new warning was that I changed that part of coreutils to not use strncat, causing 3 lines of code to grow to 8 lines. See the end of

[Bug c/85562] -Wsuggest-attribute=malloc misleads about "returning normally"

2018-05-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85562 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #2 from

[Bug c/85734] New: --suggest-attribute=malloc misdiagnoses static functions

2018-05-10 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- GCC 8's --suggest-attribute=malloc diagnoses static functions, even though the malloc attribute is useless for static functions (after all, the com

[Bug middle-end/85602] New: regression with strncat and -Wall in GCC 8

2018-05-01 Thread eggert at gnu dot org
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 44051 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44051&action=edit test program illustrating the regression I ran into some problems build

[Bug middle-end/48968] incorrect warning about longjmp/vfork clobbering a local (-W -O2, x86-64)

2017-12-26 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48968 --- Comment #13 from Paul Eggert --- (In reply to Eric Gallager from comment #12) > (In reply to Paul Eggert from comment #11) > > Also please see related bugs Bug 21161, Bug 54561, Bug 61118, Bug 65041, Bug > > 83162. Perhaps they should be merg

[Bug c/83257] New: ICE with flexible array member and -fchkp-narrow-to-innermost-array

2017-12-02 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 42778 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42778&action=edit Source file illustrating compiler bug

[Bug c/83251] __builtin___bnd_narrow_ptr_bounds(x, x, ...) generates wrong code that modifies a constant

2017-12-01 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83251 --- Comment #1 from Paul Eggert --- Created attachment 42774 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42774&action=edit Test case subroutines (you also need foomain.i)

[Bug c/83251] New: __builtin___bnd_narrow_ptr_bounds(x, x, ...) generates wrong code that modifies a constant

2017-12-01 Thread eggert at gnu dot org
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 42773 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42773&action=edit Test case main

[Bug tree-optimization/83177] ICE with -mmpx -fcheck-pointer-bounds + __builtin___bnd_narrow_ptr_bounds + _setjmp

2017-11-27 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83177 --- Comment #1 from Paul Eggert --- Created attachment 42727 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42727&action=edit Compiler output generated for crash on v.i

[Bug tree-optimization/83177] New: ICE with -mmpx -fcheck-pointer-bounds + __builtin___bnd_narrow_ptr_bounds + _setjmp

2017-11-27 Thread eggert at gnu dot org
Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Host: x86-64 Created attachment 42726 --> https://gcc.gnu.org/bugzilla/attachment.cgi

[Bug tree-optimization/80776] -Wformat-overflow false positive for %d on integer bounded by __builtin_unreachable

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80776 --- Comment #3 from Paul Eggert --- (In reply to Richard Biener from comment #1) > Possibly the walk in remove_range_assertions visits the latter before the > former block but in principle we do have code to handle this there. I just ran into th

[Bug middle-end/61118] [6/7/8 Regression] Indirect call generated for pthread_cleanup_push with constant cleanup function

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 --- Comment #14 from Paul Eggert --- Also please see related reports Bug 21161, Bug 48968, Bug 54561, Bug 65041, and Bug 83162. The last-listed one also is a regression, perhaps induced by the fancier optimization in recent GCC versions. I suspec

[Bug middle-end/48968] incorrect warning about longjmp/vfork clobbering a local (-W -O2, x86-64)

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48968 --- Comment #11 from Paul Eggert --- Also please see related bugs Bug 21161, Bug 54561, Bug 61118, Bug 65041, Bug 83162. Perhaps they should be merged?

[Bug middle-end/21161] "clobbered by longjmp" warning ignores the data flow

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=21161 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #5 from

[Bug middle-end/65041] Improve -Wclobbered

2017-11-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65041 --- Comment #4 from Paul Eggert --- Also please see Bug 83162, which may be related.

[Bug c/83162] New: x86-64 -Wclobbered issuing more false alarms (regression)

2017-11-25 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 42717 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42717&action=edit Test case for "gcc -O2 -S -Wclobbered"

[Bug middle-end/65041] Improve -Wclobbered

2017-11-19 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65041 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #3 from

[Bug middle-end/61118] Spurious -Wclobbered warning generated by gcc 4.9.0 for pthread_cleanup_push

2017-11-19 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61118 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #12

[Bug c/82914] 'struct __attribute__ ((aligned (N))) s' ignores 'aligned' attribute

2017-11-09 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82914 --- Comment #4 from Paul Eggert --- (In reply to Richard Biener from comment #2) > You are not using aligned on a 'struct or struct member' but on the variable > in all but (b). If that's the intent, then GCC is mishandling the first example I

[Bug c/82914] 'struct __attribute__ ((aligned (N))) s' ignores 'aligned' attribute

2017-11-08 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82914 --- Comment #1 from Paul Eggert --- (In reply to Paul Eggert from comment #0) Sorry, but my example in comment #0 (although it illustrates a bug) doesn't illustrate the bug that crashed GCC. Here's a better example: struct t { long mem; };

[Bug c/82914] New: 'struct __attribute__ ((aligned (N))) s' ignores 'aligned' attribute

2017-11-08 Thread eggert at gnu dot org
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I'm reporting a GCC problem that caused Emacs to SIGSEGV as described here: https://bugs.gnu.org/29183 I track

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Attachment #42149|0 |1 is obsolete|

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 Paul Eggert changed: What|Removed |Added Attachment #42148|0 |1 is obsolete|

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #3 from Paul Eggert --- (In reply to Marc Glisse from comment #2) > Note that n==(int)n (gcc documents that this must work) may work with more > gcc versions and is more readable. Thanks, good point, I'll suggest switching to that in

[Bug target/82170] gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82170 --- Comment #1 from Paul Eggert --- Created attachment 42149 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42149&action=edit assembly-language output for poorly-optimized code

[Bug target/82170] New: gcc optimizes int range-checking poorly on x86-64

2017-09-10 Thread eggert at gnu dot org
: target Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 42148 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42148&action=edit source code that is poorly optimized on x86-64 GCC on Fedora 26 x86-

[Bug c/81650] New: gcc -m32 mishandles -Walloc-size-larger-than=9223372036854775807

2017-08-01 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- This is following up a Gnulib bug report: http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00150.html which appears to stem from a bug

[Bug c/51309] -Wstrict-overflow false alarm when overflow impossible in loop body

2017-07-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51309 --- Comment #2 from Paul Eggert --- (In reply to Eric Gallager from comment #1) > I can't seem to reproduce the warning Thanks, I can no longer reproduce the warning either. I used GCC 7.1.1 20170622 (Red Hat 7.1.1-3). So it looks like the probl

[Bug sanitizer/80659] [7/8 Regression] -fsanitize=address evokes ICE in in gimplify_switch_expr

2017-05-16 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80659 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #8 from

[Bug c/80787] New: gcc -Wmaybe-uninitialized false negative when compiling Emacs

2017-05-16 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I found this problem when compiling GNU Emacs with GCC 7.1.0 and with Clang 3.9.1. GCC missed an uninitialized-variable bug that Clang correctly

[Bug c/80776] New: -Wformat-overflow false positive for %d on integer bounded by __builtin_unreachable

2017-05-16 Thread eggert at gnu dot org
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I found this problem when compiling Emacs with GCC 7.1.0 on x86-64. Emacs uses __builtin_unreachable to let the compiler know

[Bug debug/80646] [5/6/7 Regression] wrong type info for extern inline function when compiling Emacs

2017-05-08 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80646 --- Comment #3 from Paul Eggert --- (In reply to Richard Biener from comment #1) > So I start to belive this is a gdb bug. Thanks, I filed a GDB bug report here: https://sourceware.org/bugzilla/show_bug.cgi?id=21473

[Bug ipa/53896] nonreturning function suggested as 'pure' candidate

2017-05-05 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53896 --- Comment #3 from Paul Eggert --- (In reply to Martin Liška from comment #2) > it's still up to user to mark the function as pure. Thanks for looking into it. We have worked around the problem in GNU Emacs by avoiding the -Wsuggest-attribute=p

[Bug debug/80646] New: [Regression] wrong type info for extern inline function when compiling Emacs

2017-05-05 Thread eggert at gnu dot org
: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 41327 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41327&action=edit gzipped tarball of three

[Bug c/80515] __attribute__ ((__noreturn__)) false alarm for 'main'

2017-04-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80515 --- Comment #6 from Paul Eggert --- > main always return according to the standard No, the C standard does not require 'main' to return. It's perfectly acceptable for 'main' to never return, and many programs are written that way. > what you ar

[Bug c/80515] __attribute__ ((__noreturn__)) false alarm for 'main'

2017-04-25 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80515 --- Comment #4 from Paul Eggert --- > main() has an implicit return 0. That's irrelevant to the purpose of the warning. The warning is there to catch the common typo of a function containing a return statement even though it is declared 'noretur

[Bug c/80515] New: __attribute__ ((__noreturn__)) false alarm for 'main'

2017-04-25 Thread eggert at gnu dot org
iority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- For this one-line C program: __attribute__ ((__noreturn__)) int main (void) { for (;;); } GCC complains: : warning: function declared ‘noreturn’ has a ‘return’

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2017-02-15 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 --- Comment #12 from Paul Eggert --- Ah, sorry, I am using GCC 6.3.1, whereas __builtin_mul_overflow_p is a GCC 7-ism. Somehow I got it into my head that __builtin_mul_overflow(A,B,C) should be a constant expression if A, B, are constant express

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2017-02-15 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 --- Comment #10 from Paul Eggert --- Unfortunately, the patch for Bug#68120 does not seem to have addressed the problem here. For example, although the following code uses the new feature enabled by that patch: int f (void) { return (__bui

[Bug middle-end/4210] should not warning with dead code

2017-02-15 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210 --- Comment #25 from Paul Eggert --- I'd like this bug to be changed from SUSPENDED to CONFIRMED, given that it's continuing to be a problem (e.g., bug#79479). Also, I'd like to suggest what I hope is a simple fix. In 2006 Joseph wrote "skip_eval

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-15 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #14 from Paul Eggert --- Thanks, please feel free to mark this as a duplicate of Bug#4210. I plan to follow up there.

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-14 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #12 from Paul Eggert --- If the proposed change would introduce significant problems with false positives or false negatives, then surely GCC already has these problems in conditional expressions. These problems ought to be addressed

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #9 from Paul Eggert --- > 1) It's too subtle for non-expert programmers to understand. Actually, it's typically easy for non-experts to follow this. For example, although GCC falsely warns about this: /*1*/ if (0) return INT_MAX +

[Bug c/79479] -Woverflow false alarm in unreachable expression

2017-02-13 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79479 --- Comment #7 from Paul Eggert --- > the translation of a program that contains an overflowing constant expression > has undefined behavior Sure, but the programs in question do not contain constant expressions in sense of the C standard. They

[Bug c/79479] New: -Woverflow false alarm in unreachable expression

2017-02-12 Thread eggert at gnu dot org
: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 40722 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40722&action=edit gcc -m32 -Woverflow incorrectly complains about this Compile the attached

[Bug debug/78685] -Og generates too many ""s

2016-12-21 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78685 --- Comment #5 from Paul Eggert --- Just to clarify: 'main' (in the sample program) is just an example. The problems developers are seeing when debugging Emacs almost all involve functions other than 'main'. It should be OK for -Og to optimize s

[Bug debug/78685] New: -Og generates too many ""s

2016-12-05 Thread eggert at gnu dot org
ent: debug Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Host: x86-64 Created attachment 40253 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40253&action=edit preprocessed C program illustrating -Og problem Ema

[Bug c/78339] New: -fcheck-pointer-bounds breaks -fsuggest-attribute=noreturn on main 'exit'

2016-11-13 Thread eggert at gnu dot org
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I found this bug when trying to build Emacs with -fcheck-pointer-bounds. Suppose the file profile.i contains: extern _Nor

[Bug c/78081] New: -Wmaybe-initialized false-alarm regression for Emacs regex.c

2016-10-22 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 39869 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39869&action=edit test program illustrating -Wmaybe-uninit

[Bug c/77876] New: -Wbool-operation rejects useful code involving '~'

2016-10-05 Thread eggert at gnu dot org
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- GCC's recently-added -Wbool-operation flag rejects useful code like this: #include enum { BILLION = 1000 * 1000 * 1000 }; time_t foo (time_t s, int res) { return

[Bug c/71157] -Wnull-dereference false alarm in wrong function

2016-07-04 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71157 --- Comment #6 from Paul Eggert --- > this is because it thinks skip_space() may return NULL: That sounds like a bug, then, as skip_spaces immediately dereferences its argument, so it cannot possibly return NULL. Also, skip_spaces is never pass

[Bug c/71157] -Wnull-dereference false alarm in wrong function

2016-05-19 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71157 --- Comment #4 from Paul Eggert --- I worked around the GCC bug by applying the attached file etags.c.patch to GNU Emacs. etags.c.patch replaces some weird but valid C code (add a small constant to a pointer and test whether the resulting pointer

[Bug c/71157] -Wnull-dereference false alarm in wrong function

2016-05-19 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71157 --- Comment #3 from Paul Eggert --- Created attachment 38532 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38532&action=edit patched version of e.i that avoids GCC bug

[Bug c/71157] -Wnull-dereference false alarm in wrong function

2016-05-19 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71157 --- Comment #2 from Paul Eggert --- Created attachment 38531 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38531&action=edit GNU Emacs lib-src/etags.c patch to work around GCC bug

[Bug c/71157] New: -Wnull-dereference false alarm in wrong function

2016-05-16 Thread eggert at gnu dot org
: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Created attachment 38504 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38504&action=edit preprocessed source code for emacs/lib-src/etags.c I discovered this when co

[Bug c/68120] can't easily deal with integer overflow at compile time

2016-05-01 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120 --- Comment #6 from Paul Eggert --- (In reply to Martin Sebor from comment #5) > Patch posted for review: > https://gcc.gnu.org/ml/gcc-patches/2016-05/msg00013.html Thanks. This patch appears to address almost all the request, and it is definite

[Bug c++/69763] _Alignof(double) in C gives different results from alignof(double) in C++

2016-02-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69763 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #1 from

[Bug c/68120] can't easily deal with integer overflow at compile time

2015-12-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68120 --- Comment #2 from Paul Eggert --- (In reply to Paul Eggert from comment #0) > I am working around the problem with macro definitions like this: > > # define INT_ADD_OVERFLOW(a, b) \ >(__builtin_constant_p ((a) == (b)) \ > ? _GL_INT_AD

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2015-12-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 --- Comment #8 from Paul Eggert --- (In reply to Martin Sebor from comment #7) > Perhaps what's needed is for GCC to treat the builtins as constant > expressions when they're invoked with them as operands. If you agree with > that approach, I s

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2015-12-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 --- Comment #6 from Paul Eggert --- (In reply to Martin Sebor from comment #5) > This is a valid constant expression I'm aware of the distinction between constant and other expressions. I'm trying to give the ordinary user's viewpoint, not the v

[Bug c/68971] -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2015-12-17 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68971 --- Comment #4 from Paul Eggert --- (In reply to Martin Sebor from comment #1) > constant expressions are evaluated during translation This is not a constant expression. Not that that should matter. For example: enum { a = (1 ? 0 : 1 / 0) };

[Bug c/68971] New: -Woverflow false alarm in code unreachable after __builtin_mul_overflow

2015-12-17 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Compile the following code with 'gcc -O2 -S u.c' (x86-64, GCC 5.3.1 20151207 (Red Hat 5.3.1-2)): int main (void) {

[Bug c/68193] New: _Generic -Woverflow false alarm

2015-11-02 Thread eggert at gnu dot org
Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I ran into this problem when developing Gnulib code. This is with GCC 5.2.0 on x86-64. Compile the following program t.c with 'gcc -Wall t.c': int main (void) { int i = 0; int j

[Bug c/68121] New: __builtin_constant_p should not warn about integer overflow

2015-10-27 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- Compile this with "gcc -S" (x86-64): enum { x = 20, y = 20, a = __builtin_constant_p (x + y) ? x : -1, };

[Bug c/68120] New: can't easily deal with integer overflow at compile time

2015-10-27 Thread eggert at gnu dot org
ement Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- This is a followup to Bug#61129, which asked for integer-overflow-detecting arithmetic intrinsics. We have them now (thanks!) but I'm ru

[Bug target/68110] __builtin_sub_overflow unsigned performance issue

2015-10-26 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68110 --- Comment #3 from Paul Eggert --- (In reply to Andrew Pinski from comment #2) > So the question is does anyone use this function without "a - b" later on? Not that I know of. The usual pattern for callers of the Gnulib macro is to use the mac

[Bug c/68110] New: __builtin_sub_overflow unsigned performance issue

2015-10-26 Thread eggert at gnu dot org
: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- I ran into this minor performance issue when changing Gnulib's lib/intprops.h to use the new __builtin_sub_overflow function. I found that __builtin_sub_overflow is less effi

[Bug c/68046] New: -ftrapv doesn't catch leaq-based overflows on x86-64

2015-10-21 Thread eggert at gnu dot org
y: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Target Milestone: --- On x86-64 for this program: long i = 0x7fffL; int main (void) { return i + 1 < i; } gcc -ftrapv -O2 -S generates this code: main: movqi(%ri

[Bug sanitizer/67662] New: -fsanitize=undefined cries wolf for X - 1 + X when X is 2**30

2015-09-20 Thread eggert at gnu dot org
Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org 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 Target Milestone

[Bug c/28901] -Wunused-variable ignores unused const initialised variables

2015-09-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 --- Comment #12 from Paul Eggert --- (In reply to Manuel López-Ibáñez from comment #11) > Another alternative is to only warn if the variable is defined in the main > file (MAIN_FILE_P) as opposed to an included file. Thanks, this is a reasonab

[Bug c/28901] -Wunused-variable ignores unused const initialised variables

2015-09-18 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28901 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #10

[Bug c/63943] New: -Wmaybe-uninitialized pragma mishandled in inlined function

2014-11-18 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Created attachment 34031 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34031&action=edit Program with -Wmaybe-uninitialized problem Compile the attached prog

[Bug c/63877] New: - -Wmissing-declarations produces false alarms for C99 inline functions

2014-11-14 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org This is a followup to PR c/54113, which was about -Wmissing-prototypes. This followup bug report is the same, except it is about -Wmissing-declarations

[Bug c/63495] struct __attribute__ ((aligned (8))) broken on x86

2014-10-10 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63495 --- Comment #6 from Paul Eggert --- That was fast! Thank you.

[Bug c/63495] New: struct __attribute__ ((aligned (8))) broken on x86

2014-10-08 Thread eggert at gnu dot org
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Compile and run the following two-line program with an x86 target: struct __attribute__ ((aligned (8))) s { char c; }; _Static_assert (_Alignof (struct s) >= 8, "wrong alignment"); This s

[Bug middle-end/61409] [4.9/4.10 regression] -Wmaybe-uninitialized false-positive with -O2

2014-06-04 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61409 --- Comment #3 from Paul Eggert --- (In reply to Manuel López-Ibáñez from comment #1) > My guess is that what is uninitialized is "rw" and some optimization pass > messed up the variable names when creating temporaries. I'm afraid it's more ser

[Bug c/61409] New: [4.9 regression] -Wmaybe-uninitialized false-positive with -O2

2014-06-04 Thread eggert at gnu dot org
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: eggert at gnu dot org Created attachment 32887 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32887&action=edit sample program illustrating the false positive GCC 4.9.0 x86-64

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-22 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Paul Eggert changed: What|Removed |Added Attachment #32832|0 |1 is obsolete|

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #18 from Paul Eggert --- (In reply to Richard Biener from comment #16) > void foo (int *p) > { > int *q = realloc (p, sizeof (int)); > *q = 2; > } > > may I remove the store *q = 2 as dead? Yes, the consensus nowadays is that y

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #14 from Paul Eggert --- (In reply to Dan Gohman from comment #13) > *p can't alias a or b without violating the weaker assumption. Sorry, you've lost me there. Pointers in realloc'ed storage can alias already-existing pointers, an

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #12 from Paul Eggert --- (In reply to Rich Felker from comment #10) > This assumption only aids > optimization in the case where a pointer residing in the obtained memory is > used (e.g. dereferenced or compared with another pointer)

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #11 from Paul Eggert --- Created attachment 32834 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32834&action=edit Sample illustrating GCC's optimization with __attribute__ ((malloc))

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Paul Eggert changed: What|Removed |Added Attachment #32831|0 |1 is obsolete|

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #8 from Paul Eggert --- Comment on attachment 32831 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32831 Clarify documentation for __attribute__ ((malloc)). >Index: gcc/ChangeLog >===

  1   2   >