On Fri, 10 Jun 2016, Jakub Jelinek wrote: > On Fri, Jun 10, 2016 at 03:13:32PM +0300, Maxim Ostapenko wrote: > > gcc/ChangeLog: > > > > 2016-06-10 Maxim Ostapenko <m.ostape...@samsung.com> > > > > PR sanitizer/71480 > > * varasm.c (place_block_symbol): Adjust alignment for asan protected > > STRING_CSTs even if TREE_CONSTANT_POOL_ADDRESS_P. > > > > gcc/testsuite/ChangeLog: > > > > 2016-06-10 Maxim Ostapenko <m.ostape...@samsung.com> > > > > PR sanitizer/71480 > > * c-c++-common/asan/pr71480.c: New test. > > > > diff --git a/gcc/testsuite/c-c++-common/asan/pr71480.c > > b/gcc/testsuite/c-c++-common/asan/pr71480.c > > new file mode 100644 > > index 0000000..3cf2c05 > > --- /dev/null > > +++ b/gcc/testsuite/c-c++-common/asan/pr71480.c > > @@ -0,0 +1,41 @@ > > +/* { dg-do run } */ > > + > > +__attribute__ ((noinline, noclone)) int > > +foo (char *c) > > +{ > > I'd add asm volatile ("" : : "r" (c) : "memory"); here
I'd say asm("") is sufficient. > > + return 1; > > +} > > + > > +__attribute__ ((noinline, noclone)) void > > +bar (char *c) > > +{ > > and here (so that gcc doesn't try to figure out the functions are const or > pure. This is exactly what the special-case-empty-asm is for, unless I miss something extra-special about this case. Maybe to avoid a warning for the otherwise unused c? > No need for return; in function returning void. > Ok with that change, thanks. > > Jakub >