https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101645
--- Comment #4 from Matthew Wilcox ---
On second thoughts -Wsign-conversion is useless. Consider that it warns on
this:
unsigned long f(unsigned long x, int y) {
return x + y;
}
Both gcc and clang emit a warning, which makes it useless.
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
Test case:
unsigned long a(void);
void b(long);
void c(void) {
unsigned int x = a();
b(-x);
}
There is a missed warning in the call to b(). x is negated, but as an int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7
Matthew Wilcox changed:
What|Removed |Added
CC||matthew at wil dot cx
--- Comment #1
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
I've just fixed multiple instances of bugs that look a lot like function f()
when they should have been function g(). This affects filesystems in Linux
which have to remember to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=32911
Matthew Wilcox changed:
What|Removed |Added
CC||matthew at wil dot cx
--- Comment #6
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
The diagnostic would be better if it showed the entire function prototype:
../fs/iomap/apply.c:13:1: error: conflicting types for ‘__iomap_apply’
13 | __iomap_apply(struct
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88518
--- Comment #2 from Matthew Wilcox ---
Thanks! What I actually want to do is annotate g() to the effect that it reads
the pointed-to variable before it writes it. IOW, I want to write something
like:
void g(unsigned long __attribute__((read_be
-end
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
void g(unsigned long *);
void h(void);
void f(void)
{
unsigned long i;
h();
i++;
g(&i);
}
$ gcc -Wall -O2 -c test5.c -o /dev/null
report
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
GCC knows that a pointer passed to free() is no longer valid, but it misses an
opportunity to warn here:
char f(char *foo)
{
free(foo);
return foo[0];
}
: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
The function free() is not listed as a built-in in the manual, but the source
code has several references to BUILT_IN_FREE. I believe the manual should be
adjusted as so:
-@code{fprintf}, @code{fputs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #14 from Matthew Wilcox ---
Confirmed this fixes the problem. I'll send it to Tony and see if he likes it.
May I add your Signed-off-by to the patch?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #11 from Matthew Wilcox ---
I'm sorry, I still don't get it.
What I think you're saying is that GCC performs this optimisation:
nr = 1UL << compound_order(page);
atomic_sub_return(x, nr);
into:
if (PageHead(page))
atomic_sub_ret
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #9 from Matthew Wilcox ---
Maybe I'm a little slow, but I don't see what the path is that sets 'nr' to 0.
It's 1UL << compound_order. Typically, compound_order is 0, although it may be
anything up to log2(number of pages in the mach
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #7 from Matthew Wilcox ---
OK, so how should we write this function/macro to accomplish what we want?
And the requirement is "If the argument is one of these eight special
constants, use this special instruction, otherwise call this
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #5 from Matthew Wilcox ---
Hi Aldy!
Thanks for looking into this. Yes, I agree, there's no way that GCC can know
this is a constant, but that *should* have been taken care of. Please pardon
me copying and pasting from the original
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83653
--- Comment #2 from Matthew Wilcox ---
7.2, 6.2, 5.5 and 4.9 fail. 4.6.3 succeeds.
onent: c
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
Created attachment 43009
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43009&action=edit
Gzipped preprocessed source
This is an excerpt from the Linux kerne
: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: matthew at wil dot cx
Target Milestone: ---
GCC fails to optimise
if (x & 2) y = (x &~ 2)
into
if (x & 2) y = (x - 2)
in cases where t
18 matches
Mail list logo