[Bug c/54409] [4.8 Regression] internal compiler error: in remap_predicate, at ipa-inline-analysis.c:2710

2012-08-29 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54409

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #5 from Marek Polacek  2012-08-29 
17:07:04 UTC ---
More reduced.  Reproducible with -Os and -O1.

int b;

struct S
{
  char *p; 
  struct {
  } s;
  int a;
};

static _Bool
fn2 (int *p1)
{
  if (b) 
{   
  struct S *c = (struct S *) &p1;
  return c->a;
}   
}

_Bool
fn3 (struct S *p1)
{
  if (fn2 ((int *) &p1->s))
return 0;
}


[Bug c/54428] ICE in gimplify_expr, at gimplify.c:7591

2012-08-30 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54428

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #1 from Marek Polacek  2012-08-31 
05:16:38 UTC ---
Reproduced.  Happens with 4.7/trunk, but not 4.6 and older.  Only -std=c99 is
needed, with -ffast-math the ICE does not happen.


[Bug c/54428] ICE in gimplify_expr, at gimplify.c:7591

2012-08-30 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54428

--- Comment #2 from Marek Polacek  2012-08-31 
05:46:07 UTC ---
Reduced.  Note that the typedef is needed to trigger ICE.

typedef double _Complex fftw_complex;
extern fftw_complex *fftw_alloc_complex (int);

int
cf (int n)
{
  int K = 75; 
  int nf = 1024;
  int i;
  fftw_complex *w = fftw_alloc_complex (nf);
  fftw_complex *f = fftw_alloc_complex (nf);
  double S[K * sizeof (double)];
  double s_val = S[n];
  fftw_complex *b = fftw_alloc_complex (nf);
  fftw_complex *rt = fftw_alloc_complex (nf);
  for (i = 0; i < nf; ++i)
{   
  rt[i] = f[i] - s_val * __builtin_cpow (w[i], K) * b[i];
}   
}


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #2 from Marek Polacek  2012-09-01 
10:59:21 UTC ---
Probably dup of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41045


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #3 from Marek Polacek  2012-09-01 
11:10:10 UTC ---
Also, __attribute__((naked)) for x86 will never be implemented.


[Bug inline-asm/54450] Extended asm in global scope

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54450

--- Comment #5 from Marek Polacek  2012-09-01 
13:15:46 UTC ---
(In reply to comment #4)
> May I ask why?

See e.g. http://gcc.gnu.org/ml/gcc/2004-02/msg00943.html


[Bug tree-optimization/54449] [4.8 Regression] ICE: vector VEC(T,base) index domain error, in will_be_nonconstant_expr_predicate at ipa-inline-analysis.c:1853 with -O -fno-guess-branch-probability

2012-09-01 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54449

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #1 from Marek Polacek  2012-09-01 
13:37:44 UTC ---
Does not happen anymore with trunk.  This was fixed in
http://gcc.gnu.org/viewcvs?view=revision&revision=190841


[Bug bootstrap/54419] [4.8 Regression] Compiling libstdc++-v3/src/c++11/random.cc fails on platforms not knowing rdrand

2012-09-02 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54419

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #13 from Marek Polacek  2012-09-02 
17:52:48 UTC ---
Fails also on gcc20.fsffrance.org.


[Bug c/54486] Spurious printf format warning mentions nonexistent type 'sizetype'

2012-09-04 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54486

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #1 from Marek Polacek  2012-09-05 
06:04:58 UTC ---
It is also needed to use -Wall.  Both arguments to strspn () are constants, so
in this case the __builtin_strspn () is used.  You shouldn't see this warning
with -fno-builtin-strspn.  Thus  is correct in this regard.

GCC 4.[1-5] are without warnings, with 4.6 I get:
/home/marek/rh/tests/pr54486.c: In function ‘main’:
/home/marek/rh/tests/pr54486.c:7:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘long unsigned int’ [-Wformat]
/home/marek/rh/tests/pr54486.c:8:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘long unsigned int’ [-Wformat]

with 4.7/trunk:
/home/marek/rh/tests/pr54486.c: In function ‘main’:
/home/marek/rh/tests/pr54486.c:7:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘sizetype’ [-Wformat]
/home/marek/rh/tests/pr54486.c:8:5: warning: format ‘%zu’ expects argument of
type ‘size_t’, but argument 2 has type ‘sizetype’ [-Wformat


[Bug c/54621] internal compiler error: Segmentation fault when compiling gSOAP generated Server module.

2012-09-18 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54621

Marek Polacek  changed:

   What|Removed |Added

 CC||polacek at redhat dot com

--- Comment #2 from Marek Polacek  2012-09-18 
21:33:14 UTC ---
Please provide (possibly gzipped) preprocessed source.


[Bug tree-optimization/54345] jump threading leaks e->aux heap memory

2012-09-20 Thread polacek at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54345



Marek Polacek  changed:



   What|Removed |Added



 CC||polacek at redhat dot com



--- Comment #1 from Marek Polacek  2012-09-20 
08:16:55 UTC ---

How can I reproduce this one?  I've built gcc with '--enable-languages=c,c++

--disable-bootstrap' and '--enable-languages=c,c++ --disable-bootstrap

--enable-checking=valgrind', but then e.g.

valgrind --leak-check=full --show-reachable=yes ./cc1

~/src/gcc/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-2.c -O2 -fno-tree-vrp

show nothing like this.  (In that test we certainly run the DOM pass, thus also

jump-threading.)  Or am I doing something stupid?


[Bug tree-optimization/54345] jump threading leaks e->aux heap memory

2012-09-21 Thread polacek at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54345



--- Comment #3 from Marek Polacek  2012-09-21 
15:11:08 UTC ---

Hmm.  I hoped that something like this will show the leak, but no (it does a

lot of threading with -O2--through conditionals, through loop headers and also

through latches).  But obviously it's not enough.  Any ideas, please?



extern void bla (void);

extern void bar (void);

extern void foo (void);



void

thread_through_condition (int a, int b)

{

#define E if (a > b)\

bla ();\

  else\

bar ();\

  if (a <= b)\

foo ();

#define E10 E E E E E E E E E E

#define E100 E10 E10 E10 E10 E10 E10 E10 E10 E10 E10

#define E1000 E100 E100 E100 E100 E100 E100 E100 E100 E100 E100

#define EE E1000 E1000

  EE

}



void

thread_entry_through_header (void)

{

  int i;

#define A for (i = 0; i < 42; ++i) \

bla ();

#define A10 A A A A A A A A A A

#define A100 A10 A10 A10 A10 A10 A10 A10 A10 A10 A10

#define A1000 A100 A100 A100 A100 A100 A100 A100 A100 A100 A100

#define AA A1000 A1000 A1000 A1000 A1000

  AA

}



void

thread_latch_through_header (void)

{

  int i = 0;

  int first;



#define L first = 1; i = 0;\

  do {\

if (first)\

  foo ();\

first = 0;\

bla ();\

  } while (i++ < 100);

#define L10 L L L L L L L L L L

#define L100 L10 L10 L10 L10 L10 L10 L10 L10 L10 L10

#define L1000 L100 L100 L100 L100 L100 L100 L100 L100 L100 L100

  L1000

}


[Bug middle-end/54669] [4.8 Regression] ICE: verify_flow_info failed: BB 5 last statement has incorrectly set lp with -fnon-call-exceptions

2012-09-22 Thread polacek at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54669



Marek Polacek  changed:



   What|Removed |Added



 CC||polacek at redhat dot com



--- Comment #1 from Marek Polacek  2012-09-22 
13:30:11 UTC ---

Started with http://gcc.gnu.org/viewcvs?view=revision&revision=191387


[Bug middle-end/54669] [4.8 Regression] ICE: verify_flow_info failed: BB 5 last statement has incorrectly set lp with -fnon-call-exceptions

2012-09-22 Thread polacek at redhat dot com

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54669

--- Comment #2 from Marek Polacek  2012-09-22 
14:22:46 UTC ---
With very slightly modified testcase:
int a[10];

void
foo (void)
{
  int x;
  int i;
  for (i = 0; i < 1;)
{
  int b[3];
  for (i = 0; i < 4; i++)
b[i] = a[i];
  if (&x)
a[0] = b[0];
}
}

we get:

x.c: In function ‘foo’:
x.c:4:1: error: statement marked for throw, but doesn’t
 foo (void)
 ^
# VUSE <.MEM_15>
_16 = a[0];

x.c:4:1: error: statement marked for throw, but doesn’t
# .MEM_17 = VDEF <.MEM_15>
b[0] = _16;

x.c:4:1: error: statement marked for throw, but doesn’t
# VUSE <.MEM_17>
_21 = a[1];

x.c:4:1: error: statement marked for throw, but doesn’t
# .MEM_22 = VDEF <.MEM_17>
b[1] = _21;

x.c:4:1: error: statement marked for throw, but doesn’t
# VUSE <.MEM_22>
_26 = a[2];

x.c:4:1: error: statement marked for throw, but doesn’t
# .MEM_27 = VDEF <.MEM_22>
b[2] = _26;

x.c:4:1: error: statement marked for throw, but doesn’t
# VUSE <.MEM_27>
_31 = a[3];

x.c:4:1: internal compiler error: verify_gimple failed
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


[Bug tree-optimization/54669] [4.8 regression] verify_flow_info failure after loop unrolling with -fnon-call-exceptions

2012-09-22 Thread polacek at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54669



--- Comment #5 from Marek Polacek  2012-09-22 
20:03:59 UTC ---

It happens in cunrolli pass.  It might be propagate_constants_for_unrolling. 

It seems we eventually end up removing BB 9 and 11, which might be wrong.


[Bug tree-optimization/54676] [4.8 Regression] ICE: in set_value_range, at tree-vrp.c:433

2012-09-23 Thread polacek at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54676



Marek Polacek  changed:



   What|Removed |Added



 CC||polacek at redhat dot com



--- Comment #1 from Marek Polacek  2012-09-23 
11:44:46 UTC ---

Started with http://gcc.gnu.org/viewcvs?view=revision&revision=188728


[Bug c/61081] excessive warnings: right-hand operand of comma expression has no effect

2014-05-06 Thread polacek at redhat dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61081

--- Comment #3 from Marek Polacek  ---
On Tue, May 06, 2014 at 06:33:03PM +, peter_e at gmx dot net wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61081
> 
> --- Comment #2 from Peter Eisentraut  ---
> No, these "functions" need to have a usable return value, because someone 
> could
> write
> 
> if (!sigemptyset(...))
> weirderror();

So would the following work for you?
#define sigemptyset(set) (__extension__ ({ *(set) = 0; 0; }))