https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
Marek Polacek changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #19 from Marek Polacek ---
Author: mpolacek
Date: Tue May 16 19:25:04 2017
New Revision: 248124
URL: https://gcc.gnu.org/viewcvs?rev=248124=gcc=rev
Log:
PR sanitizer/80536
PR sanitizer/80386
* cp-gimplify.c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #18 from Jakub Jelinek ---
(In reply to Marek Polacek from comment #17)
> (In reply to Jakub Jelinek from comment #16)
> > (In reply to Marek Polacek from comment #15)
> > > In C I don't think so, because we mostly call c_save_expr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #17 from Marek Polacek ---
(In reply to Jakub Jelinek from comment #16)
> (In reply to Marek Polacek from comment #15)
> > In C I don't think so, because we mostly call c_save_expr and c_fully_fold
> > therein would fold that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #16 from Jakub Jelinek ---
(In reply to Marek Polacek from comment #15)
> In C I don't think so, because we mostly call c_save_expr and c_fully_fold
> therein would fold that expression to 0. And when we call save_expr, it's
Yeah,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #15 from Marek Polacek ---
(In reply to Jakub Jelinek from comment #14)
> (In reply to Marek Polacek from comment #13)
> > This is true, but it happens very rarely. It can happen e.g. when the
> > fold() call in save_expr() folds
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #14 from Jakub Jelinek ---
(In reply to Marek Polacek from comment #13)
> This is true, but it happens very rarely. It can happen e.g. when the
> fold() call in save_expr() folds away the first operand of a COMPOUND_EXPR,
> and the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #13 from Marek Polacek ---
(In reply to Jakub Jelinek from comment #12)
> (In reply to Marek Polacek from comment #11)
> > (In reply to Jakub Jelinek from comment #5)
> > > To expand on that, I think we want to drop that call from
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #12 from Jakub Jelinek ---
(In reply to Marek Polacek from comment #11)
> (In reply to Jakub Jelinek from comment #5)
> > To expand on that, I think we want to drop that call from there and instead
> > be able to simplify somehow a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #11 from Marek Polacek ---
(In reply to Jakub Jelinek from comment #5)
> To expand on that, I think we want to drop that call from there and instead
> be able to simplify somehow a SAVE_EXPR if after c_fully_fold or cp_fold it
>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #10 from Marek Polacek ---
Removing the fold() call doesn't regress anything, btw.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #9 from Marek Polacek ---
Well, I hope we're not. Very much related: PR80386.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #8 from Jakub Jelinek ---
But we ideally shouldn't be folding anything until we actually c_fully_fold or
cp_fold recursively, starting with the leafs. Most of the folders heavily rely
on that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #7 from Marek Polacek ---
I.e. I'm worried we could trigger the endless recursion also if we happen to
call fold() on that expression via a different path than from save_expr.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #6 from Marek Polacek ---
Yeah, it helps with this particular testcase (and I agree we want to get rid of
that fold() call in save_expr -- I'll take care of it), but I wonder if this
issue is something separate: starting with r230506
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #5 from Jakub Jelinek ---
To expand on that, I think we want to drop that call from there and instead be
able to simplify somehow a SAVE_EXPR if after c_fully_fold or cp_fold it
becomes simple enough not to require any saving.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #4 from Jakub Jelinek ---
Would dropping the fold call from save_expr fix this?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
--- Comment #3 from Marek Polacek ---
Better testcase:
int
foo (int i)
{
return ((i * (unsigned long long) (-0 + 1UL)) * 2) % 1;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
Richard Biener changed:
What|Removed |Added
Priority|P3 |P2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536
Marek Polacek changed:
What|Removed |Added
Target Milestone|--- |6.4
Summary|UBSAN: compile
20 matches
Mail list logo