[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-23 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

Martin Liška  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #7 from Martin Liška  ---
Fixed on master.

[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-23 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/g:3f8384545784696fbd66aaec24a998a819e912c5

commit r11-7346-g3f8384545784696fbd66aaec24a998a819e912c5
Author: Martin Liska 
Date:   Tue Feb 23 09:01:53 2021 +0100

IPA ICF + ASAN: do not merge vars with different alignment

gcc/ChangeLog:

PR sanitizer/99168
* ipa-icf.c (sem_variable::merge): Do not merge 2 variables
with different alignment. That leads to an invalid red zone
size allocated in runtime.

gcc/testsuite/ChangeLog:

PR sanitizer/99168
* c-c++-common/asan/pr99168.c: New test.

[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

--- Comment #5 from Martin Liška  ---
(In reply to zhan3299 from comment #4)
> (In reply to Martin Liška from comment #3)
> > Very interesting issue, the failure is caused by IPA ICF that merges 2
> > variables with different alignments. I've got a patch candidate.
> 
> Hi, just curious because I am also studying the source code of GCC.
> 
> Is this issue is about sanitizer or optimization?

It's bad optimization done by IPA ICF. The issue is gone with -fno-ipa-icf.

[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-22 Thread zhan3299 at purdue dot edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

--- Comment #4 from zhan3299 at purdue dot edu ---
(In reply to Martin Liška from comment #3)
> Very interesting issue, the failure is caused by IPA ICF that merges 2
> variables with different alignments. I've got a patch candidate.

Hi, just curious because I am also studying the source code of GCC.

Is this issue is about sanitizer or optimization?

[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

--- Comment #3 from Martin Liška  ---
Very interesting issue, the failure is caused by IPA ICF that merges 2
variables with different alignments. I've got a patch candidate.

[Bug sanitizer/99168] inconsistent behavior on -O0 and -O2 with ASAN on

2021-02-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99168

Martin Liška  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-02-22

--- Comment #2 from Martin Liška  ---
I'll take a look.