Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-14 Thread Jan Hubicka
> On Mon, Jul 14, 2014 at 09:50:34AM -0400, Jason Merrill wrote: > > >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1: > > >> error: non-constant condition for static assertion > > >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1: > >

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-14 Thread Jakub Jelinek
On Mon, Jul 14, 2014 at 09:50:34AM -0400, Jason Merrill wrote: > >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1: > >> error: non-constant condition for static assertion > >>/daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1: > >> error:

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-14 Thread Jason Merrill
On 07/14/2014 04:36 AM, Jan Hubicka wrote: FAIL: g++.dg/cpp0x/static_assert9.C -std=c++11 (test for excess errors) Excess errors: /daten/aranym/gcc/gcc-20140714/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1: error: non-constant condition for static assertion /daten/aranym/gcc/gcc-20140714/gcc

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-14 Thread Jan Hubicka
> Jan Hubicka writes: > > > * cgraph.h (symtab_node): Add nonzero_address. > > (decl_in_symtab_p): Break out from ... > > (symtab_get_node): ... here. > > * fold-const.c: Include cgraph.h > > (tree_single_nonzero_warnv_p): Use symtab to determine > > if symbol is non-zero.

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-14 Thread Andreas Schwab
Jan Hubicka writes: > * cgraph.h (symtab_node): Add nonzero_address. > (decl_in_symtab_p): Break out from ... > (symtab_get_node): ... here. > * fold-const.c: Include cgraph.h > (tree_single_nonzero_warnv_p): Use symtab to determine > if symbol is non-zero. >

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-07-13 Thread Jan Hubicka
Hi, this is variant of patch I comitted (the change is only testsuite compensation for pr36902 and 44024) and updated predicate name to nonzero_address Honza * cgraph.h (symtab_node): Add nonzero_address. (decl_in_symtab_p): Break out from ... (symtab_get_node): ... here.

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-06-25 Thread Joseph S. Myers
On Wed, 25 Jun 2014, Richard Biener wrote: > On Tue, 24 Jun 2014, Jan Hubicka wrote: > > > > > The problem is that the patch fails testcases that assume we do such > > > > folding at parsing > > > > time. > > > > > > > > ./testsuite/gcc/gcc.sum:FAIL: gcc.dg/pr36901-1.c (test for excess > > > >

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-06-25 Thread Richard Biener
On Tue, 24 Jun 2014, Jan Hubicka wrote: > > > The problem is that the patch fails testcases that assume we do such > > > folding at parsing > > > time. > > > > > > ./testsuite/gcc/gcc.sum:FAIL: gcc.dg/pr36901-1.c (test for excess errors) > > > ./testsuite/gcc/gcc.sum:FAIL: gcc.dg/pr36901-2.c (te

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-06-24 Thread Jan Hubicka
> > The problem is that the patch fails testcases that assume we do such > > folding at parsing > > time. > > > > ./testsuite/gcc/gcc.sum:FAIL: gcc.dg/pr36901-1.c (test for excess errors) > > ./testsuite/gcc/gcc.sum:FAIL: gcc.dg/pr36901-2.c (test for excess errors) > > ./testsuite/gcc/gcc.sum:FAI

Re: [RFC] Making fold-const sane WRT symbol visibilities

2014-06-24 Thread Richard Biener
On Tue, 24 Jun 2014, Jan Hubicka wrote: > Hello, > fold-const contains quite few confused statements that deal with WEAK > visibility and aliases: > > static int > simple_operand_p (const_tree exp) > { > /* Strip any conversions that don't change the machine mode. */ > STRIP_NOPS (exp); >

[RFC] Making fold-const sane WRT symbol visibilities

2014-06-23 Thread Jan Hubicka
Hello, fold-const contains quite few confused statements that deal with WEAK visibility and aliases: static int simple_operand_p (const_tree exp) { /* Strip any conversions that don't change the machine mode. */ STRIP_NOPS (exp); return (CONSTANT_CLASS_P (exp) || TREE_CODE (exp)