[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-16 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536 Marek Polacek changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-16 Thread mpolacek at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-11 Thread jakub at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-11 Thread mpolacek at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-11 Thread jakub at gcc dot gnu.org
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,

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-11 Thread mpolacek at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-10 Thread jakub at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-10 Thread mpolacek at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-10 Thread jakub at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-10 Thread mpolacek at gcc dot gnu.org
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 >

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536 --- Comment #10 from Marek Polacek --- Removing the fold() call doesn't regress anything, btw.

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread mpolacek at gcc dot gnu.org
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.

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread jakub at gcc dot gnu.org
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.

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread mpolacek at gcc dot gnu.org
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.

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread mpolacek at gcc dot gnu.org
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

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread jakub at gcc dot gnu.org
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.

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread jakub at gcc dot gnu.org
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?

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-05-09 Thread mpolacek at gcc dot gnu.org
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; }

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-04-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536 Richard Biener changed: What|Removed |Added Priority|P3 |P2

[Bug sanitizer/80536] [6/7/8 Regression] UBSAN: compile time segfault

2017-04-26 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80536 Marek Polacek changed: What|Removed |Added Target Milestone|--- |6.4 Summary|UBSAN: compile