[Bug c++/58822] Segfault when calling make_shared

2016-04-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58822

Jonathan Wakely  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |INVALID

--- Comment #28 from Jonathan Wakely  ---
If you compile it with -fsanitize=undefined then at runtime you get:

/usr/include/c++/4.8/ext/new_allocator.h:120:4: runtime error: cast to virtual
base of address 0x013d1ca0 which does not point to an object of type
'InvalidArgumentException'
0x013d1ca0: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  31 00 00 00 00 00 00 00  06 00 00 00 00
00 00 00  06 00 00 00
  ^~~
  invalid vptr

[Bug c++/70644] New: Warn about implicit conversion of 'this' to pointer to virtual base class during construction

2016-04-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70644

Bug ID: 70644
   Summary: Warn about implicit conversion of 'this' to pointer to
virtual base class during construction
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

(Reduced from PR 58822)

struct Base { Base(int) { } };

int foo(Base*) { return 0; }

struct X : virtual Base {
  X() : Base(foo(this)) { }
};

int main() {
  X x;
}

The implicit conversion in the call foo(this) is undefined behaviour. It
violates [basic.life] 3.8p6 (6.3) by converting the object's address to a
pointer to virtual base before it is constructed.

There is no warning, and no ubsan error.

If the implicit conversion happens in a different scope, not inside the
constructor, then we get a ubsan error (and segfault):

struct Base { Base(int) { } };

struct X;
int foo(X*);

struct X : virtual Base {
  X() : Base(foo(this)) { }
};

int foo(X* x) { Base* b = x; return 0; }

int main() {
  X x;
}

vb.cc:10:27: runtime error: cast to virtual base of address 0x7ffd25ef32f0
which does not point to an object of type 'X'
0x7ffd25ef32f0: note: object has invalid vptr
 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  90 0a 40 00 00
00 00 00  80 65 20 63
  ^~~
  invalid vptr
Segmentation fault (core dumped)


Since the original example is also UB it would be good to either get a
diagnostic from the front end at the point of the implicit conversion, or at
least get a ubsan error..

[Bug c++/70636] Link failure when C++ brace initialization is used

2016-04-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70636

--- Comment #1 from Jonathan Wakely  ---
This looks familiar, it might be a duplicate of another bug.

[Bug c++/58822] Segfault when calling make_shared

2016-04-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58822

--- Comment #29 from Jonathan Wakely  ---
(In reply to Michi Henning from comment #27)
> So, this is UB. Really nasty, in the sense that
> 
> make_shared(args) doesn't always do the same thing as shared_ptr(new
> T(args))

It does do effectively the same thing. The difference in behaviour is because
when you use shared_ptr(new T(this)) the implicit cast happens inside the
class, and the compiler can resolve it without inspecting the vtable.

When you use make_shared the implicit cast happens deep inside a nested
function and so it inspects the vtable, which is not yet valid because the base
object isn't constructed, so trying to access the vtable crashes.

You can cause the same crash by doing:

class InvalidArgumentException;
Exception* cast(InvalidArgumentException*);

class InvalidArgumentException : public virtual Exception
{
public:
explicit InvalidArgumentException(std::string const&)

: Exception(std::shared_ptr(new
ExceptionImplBase(cast(this
{
}

virtual ~InvalidArgumentException() noexcept {}
};

Exception* cast(InvalidArgumentException* p) { return p; }


The function 'cast' moves the implicit cast into a separate function, which
reproduces the same crash.

It should be possible to add a warning for the case where the cast happens
inside the class (which doesn't crash, but is still UB) but it won't be
possible to warn for the other cases, because at the site of the implicit cast
the compiler doesn't know whether the pointer refers to a constructed object or
not. I've created PR 70644.

[Bug target/70566] [4.9/5 Regression] Bad ARM code generated for evaluating unsigned int bitfield value

2016-04-13 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70566

--- Comment #13 from ktkachov at gcc dot gnu.org ---
Author: ktkachov
Date: Wed Apr 13 08:24:43 2016
New Revision: 234931

URL: https://gcc.gnu.org/viewcvs?rev=234931&root=gcc&view=rev
Log:
[ARM] PR target/70566 Check that condition register is dead in tst-imm ->
lsls-imm Thumb2 peepholes

Backport from mainline
2016-04-08  Kyrylo Tkachov  

PR target/70566
* config/arm/thumb2.md (tst + branch-> lsls + branch
peephole below *orsi_not_shiftsi_si): Require that condition
register is dead after the peephole.
(second peephole after the above): Likewise.

* gcc.c-torture/execute/pr70566.c: New test.


Added:
branches/gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr70566.c
Modified:
branches/gcc-4_9-branch/gcc/ChangeLog
branches/gcc-4_9-branch/gcc/config/arm/thumb2.md
branches/gcc-4_9-branch/gcc/testsuite/ChangeLog

[Bug target/70566] [4.9/5/6 Regression] Bad ARM code generated for evaluating unsigned int bitfield value

2016-04-13 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70566

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
Summary|[4.9/5 Regression] Bad ARM  |[4.9/5/6 Regression] Bad
   |code generated for  |ARM code generated for
   |evaluating unsigned int |evaluating unsigned int
   |bitfield value  |bitfield value

--- Comment #14 from ktkachov at gcc dot gnu.org ---
Fixed on all active branches.
Thanks for the bug report.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #28 from Jakub Jelinek  ---
For the #c0 difference with the #c20 instrumentation there is:
/tmp/uids:"yynewstate" label_decl 101636 0 3
/tmp/uids:"yyabortlab" label_decl 101638 0 3
/tmp/uids:"yyacceptlab" label_decl 101639 0 3
/tmp/uids:"yyacceptlab" label_decl 139896 0 2
/tmp/uids:"yyabortlab" label_decl 139897 0 2
/tmp/uids:"yynewstate" label_decl 139898 0 2
/tmp/uids_:"yynewstate" label_decl 101633 0 3
/tmp/uids_:"yyabortlab" label_decl 101635 0 3
/tmp/uids_:"yyacceptlab" label_decl 101636 0 3
/tmp/uids_:"yynewstate" label_decl 139354 0 2
/tmp/uids_:"yyacceptlab" label_decl 139357 0 2
/tmp/uids_:"yyabortlab" label_decl 139358 0 2
which means that it is all about LABEL_DECLs, which are first created using
build_decl in the same order, just with tiny differences in DECL_UID, but then
the are copy_node copied in different order.  So guess the question is why they
are copied in the different order.

[Bug middle-end/70638] transaction_wrap: too strict compatibility check and transaction_pure wrappers fail to wrap

2016-04-13 Thread hillel.avni at huawei dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70638

Hillel  changed:

   What|Removed |Added

 CC||hillel.avni at huawei dot com

--- Comment #2 from Hillel  ---
On gcc-linaro-4.9-2014.11, I must declare the wrapper as pure. 
Safe / unsafe wrappers do not compile.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #29 from Jakub Jelinek  ---
The different order of copy_node_stat happens during tree_function_versioning
-> remap_blocks -> remap_block -> remap_decls -> remap_decl ->
copy_decl_no_change -> copy_node_stat, and the BLOCK_VARS are already ordered
differently there:
BLOCK #0 
  SUPERCONTEXT: X_yyparse
  SUBBLOCKS: BLOCK #621  BLOCK #623  
  VARS: yynewstate yysetstate yybackup yyacceptlab yyabortlab yyssa yyssp yyn
yyresult 
vs.
BLOCK #0 
  SUPERCONTEXT: X_yyparse
  SUBBLOCKS: BLOCK #676  BLOCK #678  
  VARS: yybackup yyacceptlab yyabortlab yynewstate yysetstate yystate
yyerrstatus yyssa yyss yyssp yyvsa yyvs yyvsp yystacksize yyn yyresult yytoken
yyval yylen 
(the first one is from -g0, the latter -g2).  Let me debug where the order
comes from.

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

Alan Modra  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
   Last reconfirmed||2016-04-13
 CC||amodra at gmail dot com
 Resolution|INVALID |---
 Ever confirmed|0   |1

--- Comment #7 from Alan Modra  ---
My analysis says this is not a linker error.  Pass/fail depends on whether
"img" points to a 16-byte aligned ImageParameters or only 8-byte aligned, and
that depends on how commons happen to be laid out.

Curiously, when the ImageParameters struct is 16-byte aligned, img->mprr_2 is
*not* 16-byte aligned since its offset is 4792 bytes.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #30 from Jakub Jelinek  ---
Ah, the reason is clear,
  hash_table *x_named_labels;
hashes based on DECL_UID (that is fine), and adds the labels during hash table
traversal (which is not fine).
Both:
static void
pop_labels (tree block)
{
  if (named_labels)
{
  named_labels->traverse (block);
  named_labels = NULL;
}
}
and
poplevel's
  if (cfun && !functionbody && named_labels)
named_labels->traverse
   (current_binding_level);
look wrong in this regard.

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

2016-04-13 Thread jiwang at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70628

Jiong Wang  changed:

   What|Removed |Added

 CC||jiwang at gcc dot gnu.org

--- Comment #9 from Jiong Wang  ---
(In reply to Jakub Jelinek from comment #7)
> Created attachment 38242 [details]
> gcc6-pr70628.patch
> 
> IMNSHO simplify-rtx.c should never generate instructions, it carefully uses
> gen_lowpart_no_emit hook instead of gen_lowpart etc., but the
> convert_memory_addr seems to be the only cases which violate this.


And looks to me postreload is doing uncessary transformation.

AArch64 failed the following check in reload_cse_simplify_operands:

  if (MEM_P (op)
  && GET_MODE_BITSIZE (GET_MODE (op)) < BITS_PER_WORD
  && LOAD_EXTEND_OP (GET_MODE (op)) != UNKNOWN)
{

because for ILP32, we still define UNITS_PER_WORD to be 8, while x86 defined
that to be 4, thus AArch64 triggered those "make the extension explicit" code,
and trying to transform

(insn 341 111 108 12 (set (reg/f:SI 0 x0 [189])
(mem/c:SI (plus:DI (reg/f:DI 29 x29)
(const_int 104 [0x68])) [5 %sfp+-8 S4 A32])) bug-1.c:23 49
{*movsi_aarch64}
 (nil))

into:

(insn 341 111 108 12 (set (reg:DI 0 x0)
(zero_extend:DI (mem/c:SI (plus:DI (reg/f:DI 29 x29)
(const_int 104 [0x68])) [5 %sfp+-8 S4 A32]))) bug-1.c:23 84
{*zero_extendsidi2_aarch64}
 (nil))

which looks uncessary to me.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #31 from Jakub Jelinek  ---
Created attachment 38249
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38249&action=edit
gcc6-pr70594-labels.patch

Only the first spot is problematic IMHO, the latter is only for diagnostics,
and I think we don't care that much if for multiple errors in there we diagnose
in the exact same order for -g vs. -g0.

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

Alan Modra  changed:

   What|Removed |Added

 Status|REOPENED|NEW

--- Comment #8 from Alan Modra  ---
Confirmed.  So with "images" (the ImageParameters struct) 16-byte aligned, the
misaligned code path is taken through Loop_err.  With images not 16-byte
aligned, img->mprr_2 *is* 16-byte aligned, and we take the vectorized code
path.  Which is buggy.

This is the first difference in img->mprr2 on exit from Loop_err, "images"
aligned case, ie. non-vectorized
(gdb) 
0x1012e548 :   0xd710d710
(gdb) 
0x1012e54c :   0xd710d710
(gdb) 
0x1012e550 :   0xd710d710
(gdb) 
0x1012e554 :   0xd710d710
(gdb) 
0x1012e558 :   0xd710d710
(gdb) 
0x1012e55c :   0xd710d710
(gdb) 
0x1012e560 :   0xd710d710
(gdb) 
0x1012e564 :0xd710d710

versus "images" not aligned, ie. taking vectorized path
(gdb) 
0x1012e540 :   0x
(gdb) 
0x1012e544 :   0x
(gdb) 
0x1012e548 :   0x
(gdb) 
0x1012e54c :   0x
(gdb) 
0x1012e550 :   0x
(gdb) 
0x1012e554 :   0x
(gdb) 
0x1012e558 :   0x
(gdb) 
0x1012e55c :   0x

This is img->mprr_2[1][7][0..15]

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #9 from rguenther at suse dot de  ---
On Wed, 13 Apr 2016, amodra at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130
> 
> Alan Modra  changed:
> 
>What|Removed |Added
> 
>  Status|RESOLVED|REOPENED
>Last reconfirmed||2016-04-13
>  CC||amodra at gmail dot com
>  Resolution|INVALID |---
>  Ever confirmed|0   |1
> 
> --- Comment #7 from Alan Modra  ---
> My analysis says this is not a linker error.  Pass/fail depends on whether
> "img" points to a 16-byte aligned ImageParameters or only 8-byte aligned, and
> that depends on how commons happen to be laid out.
> 
> Curiously, when the ImageParameters struct is 16-byte aligned, img->mprr_2 is
> *not* 16-byte aligned since its offset is 4792 bytes.

So does DECL_ALIGN agree with the choice by the linker?

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #10 from Richard Biener  ---
Btw, which loop is it in this function?  There are multiple ones.  I assume
the last loop nest:

  for (j=0;j< MB_BLOCK_SIZE;j++)
  {
for (i=0;i< MB_BLOCK_SIZE;i++)
{
 
img->mprr_2[PLANE_16][j][i]=max(0,min((int)img->max_imgpel_value,(iaa+(i-7)*ib
+(j-7)*ic + 16)/32));// store plane prediction
}
  }

> With images not 16-byte aligned, img->mprr_2 *is* 16-byte aligned, and we 
> take > the vectorized code path.

I'd say it _happens_ to be 16-byte aligned (by luck).  I assume nothing alignes
*img to sth bigger than 8 bytes and thus whether mprr_2 is aligned to 16 bytes
or not depends on random things (like the linker version).

[Bug rtl-optimization/70625] [4.9/5 Regression] Memory exhaustion when building specific snippet at -O2

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70625

--- Comment #5 from Richard Biener  ---
This is a duplicate of PR70623.

[Bug tree-optimization/70623] [4.9/5/6 Regression] ICE in compute_antic at -O2

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70623

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|6.0 |4.9.4
Summary|[6 Regression] ICE in   |[4.9/5/6 Regression] ICE in
   |compute_antic at -O2|compute_antic at -O2

--- Comment #5 from Richard Biener  ---
Same issue appears on the branches with the testcase from PR70625.  Fix that
fixes both in testing.

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #11 from Alan Modra  ---
Created attachment 38250
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38250&action=edit
stand alone testcase

Compile with -m64 -O3 -mcpu=power7 -fno-common

[Bug preprocessor/69650] [6 Regression] ICE in linemap_line_start, at libcpp/line-map.c:803

2016-04-13 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69650

--- Comment #58 from Bernd Schmidt  ---
Author: bernds
Date: Wed Apr 13 11:40:37 2016
New Revision: 234932

URL: https://gcc.gnu.org/viewcvs?rev=234932&root=gcc&view=rev
Log:
Patch from Roger Orr 
PR preprocessor/69650
* directives.c (do_linemarker): Reread map after calling
cpp_get_token.

Modified:
trunk/libcpp/ChangeLog
trunk/libcpp/directives.c

[Bug preprocessor/69650] [6 Regression] ICE in linemap_line_start, at libcpp/line-map.c:803

2016-04-13 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69650

Bernd Schmidt  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #59 from Bernd Schmidt  ---
Should be fixed for good now.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #32 from Jakub Jelinek  ---
Created attachment 38251
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38251&action=edit
gcc6-pr70594.patch

Alternate patch for the SRA fancy names in -fdump-final-insns= dumps (and other
TDF_NOUID dumps).

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org

--- Comment #12 from Richard Biener  ---
The preprocessed source hints at the

  for (j=0; j < MB_BLOCK_SIZE; j++)
  {
for (i=0; i < MB_BLOCK_SIZE; i++)
{
  img->mprr_2[VERT_PRED_16][j][i]=s[i][0]; // store vertical prediction
  img->mprr_2[HOR_PRED_16 ][j][i]=s[j][1]; // store horizontal prediction
  img->mprr_2[DC_PRED_16  ][j][i]=s0;  // store DC prediction
}
  }

loop instead.  Where I see

bb3:
  vect__39.11_16 = MEM[(int *)vectp_s.13_15];
  vect__39.14_17 = __builtin_altivec_mask_for_load (vectp_s.13_13);
...
bb4:
  # vect__39.15_18 = PHI 
  # vectp_s.16_20 = PHI 
  vectp_s.16_23 = vectp_s.16_20 & -16B;
  vect__39.18_24 = MEM[(int *)vectp_s.16_23];
  vect__39.19_1 = REALIGN_LOAD ;
  vectp_s.16_314 = vectp_s.16_20 + 18446744073709551608;
(oops)
...
  vectp_s.16_22 = vectp_s.16_314 + 16;
...
  if (ivtmp_210 < 15)
goto ;
  else
goto ;

  :
  goto ;

the (oops) marked IV adjustment breaks the realign-optimized handling
I believe.  It adjusts for the group gap (it subtracts 8 from the pointer)
and thus makes both the mask and the previous load value invalid.

[Bug debug/70628] [5/6 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70628

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 12:26:26 2016
New Revision: 234933

URL: https://gcc.gnu.org/viewcvs?rev=234933&root=gcc&view=rev
Log:
PR debug/70628
* rtl.h (convert_memory_address_addr_space_1): New prototype.
* explow.c (convert_memory_address_addr_space_1): No longer static,
add NO_EMIT argument and don't call convert_modes if true, pass
it down recursively, remove break after return.
(convert_memory_address_addr_space): Adjust caller.
* simplify-rtx.c (simplify_unary_operation_1): Call
convert_memory_address_addr_space_1 instead of convert_memory_address,
if it returns NULL, don't simplify.

* gcc.dg/torture/pr70628.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr70628.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/explow.c
trunk/gcc/rtl.h
trunk/gcc/simplify-rtx.c
trunk/gcc/testsuite/ChangeLog

[Bug target/70633] [5/6 Regression] ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70633

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 12:27:52 2016
New Revision: 234934

URL: https://gcc.gnu.org/viewcvs?rev=234934&root=gcc&view=rev
Log:
PR middle-end/70633
* gimplify.c (gimplify_init_constructor): Clear TREE_STATIC if
gimplification turns some element into non-constant.

* gcc.c-torture/compile/pr70633.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr70633.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #13 from Richard Biener  ---
Does the following fix it?  I'm not entirely happy with it because of the
comment.

Index: gcc/tree-vect-stmts.c
===
--- gcc/tree-vect-stmts.c   (revision 234894)
+++ gcc/tree-vect-stmts.c   (working copy)
@@ -6876,6 +6875,12 @@ vectorizable_load (gimple *stmt, gimple_
   gcc_assert (!load_lanes_p
  || alignment_support_scheme == dr_aligned
  || alignment_support_scheme == dr_unaligned_supported);
+  /* If vectors are not adjacent we can't do dr_explicit_realign_optimized.
+ ???  This fails to account for the cost of this but it's messy to
+ compute all this from within vect_supportable_dr_alignment.  */
+  if (group_gap_adj != 0
+  && alignment_support_scheme == dr_explicit_realign_optimized)
+alignment_support_scheme = dr_explicit_realign;

   /* In case the vectorization factor (VF) is bigger than the number
  of elements that we can fit in a vectype (nunits), we have to generate

[Bug c++/70641] [5/6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||hubicka at gcc dot gnu.org

[Bug debug/70628] [5 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70628

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[5/6 regression] ICE in |[5 regression] ICE in
   |get_reg_rtx, at |get_reg_rtx, at
   |emit-rtl.c:1025 |emit-rtl.c:1025

--- Comment #11 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug target/70633] [5 Regression] ICE on valid code at -Os (in 32-bit mode) on x86_64-linux-gnu: output_operand: invalid expression as operand

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70633

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[5/6 Regression] ICE on |[5 Regression] ICE on valid
   |valid code at -Os (in   |code at -Os (in 32-bit
   |32-bit mode) on |mode) on x86_64-linux-gnu:
   |x86_64-linux-gnu:   |output_operand: invalid
   |output_operand: invalid |expression as operand
   |expression as operand   |

--- Comment #6 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

2016-04-13 Thread jseward at acm dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70627

--- Comment #7 from jseward at acm dot org ---
I tried the fix at PR70029 comment 7 (disabling a check) but that
doesn't help, at least for the original, unreduced test case
(Unified_cpp_dom_animation0.ii).

[Bug middle-end/70638] transaction_wrap: too strict compatibility check and transaction_pure wrappers fail to wrap

2016-04-13 Thread torvald at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70638

--- Comment #3 from torvald at gcc dot gnu.org ---
(In reply to Hillel Avni from comment #2)
> On gcc-linaro-4.9-2014.11, I must declare the wrapper as pure. 

But using that version the wrapper was indeed used and not the original
function, right?  In that case, this part of this bug report would be a
regression.

[Bug c++/70641] [5/6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

--- Comment #2 from Jakub Jelinek  ---
Guess in the   
  if (callee_t && recursive_call_p (current_function_decl, callee_t))
continue;
case we should set some bool flag, and if we decide to set nothrow flag at the
end and we saw some recursive calls, we should adjust them.

[Bug middle-end/70638] transaction_wrap: too strict compatibility check and transaction_pure wrappers fail to wrap

2016-04-13 Thread hillel.avni at huawei dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70638

--- Comment #4 from Hillel Avni  ---
(In reply to torvald from comment #3)
> (In reply to Hillel Avni from comment #2)
> > On gcc-linaro-4.9-2014.11, I must declare the wrapper as pure. 
> 
> But using that version the wrapper was indeed used and not the original
> function, right?  In that case, this part of this bug report would be a
> regression.

Yes, the wrapper is used.

[Bug fortran/58000] Accept OPEN( ... NAME=) with -std=legacy

2016-04-13 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58000

--- Comment #5 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Wed Apr 13 13:17:45 2016
New Revision: 234936

URL: https://gcc.gnu.org/viewcvs?rev=234936&root=gcc&view=rev
Log:
2016-04-13  Dominique d'Humieres  

PR fortran/58000
* gfortran.texi: Document OPEN( ... NAME=) as not implemented
in GNU Fortran


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/gfortran.texi

[Bug fortran/58000] Accept OPEN( ... NAME=) with -std=legacy

2016-04-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58000

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #6 from Dominique d'Humieres  ---
Jerry,

Thanks for the review.

Documented as not implemented, closing as WONTFIX.

[Bug libstdc++/70607] The return type of std::conj must be std::complex

2016-04-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70607

--- Comment #5 from Jonathan Wakely  ---
Aha, that DR was reverted by http://wg21.link/lwg1522 (I failed to find it
because the deleted text says "All the specified ..." and I searched for "All
of the specified ..."

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #14 from Bill Schmidt  ---
Unfortunately the patch doesn't help with Alan's streamlined test.  It still
fails (tested on powerpc64le).

[Bug debug/70628] [5 regression] ICE in get_reg_rtx, at emit-rtl.c:1025

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70628

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 13:57:29 2016
New Revision: 234937

URL: https://gcc.gnu.org/viewcvs?rev=234937&root=gcc&view=rev
Log:
PR debug/70628
* explow.c (convert_memory_address_addr_space_1): Formatting fix.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/explow.c

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #15 from Bill Schmidt  ---
Created attachment 38252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38252&action=edit
Vectorization dump without patch

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #16 from Bill Schmidt  ---
Created attachment 38253
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38253&action=edit
Vectorization dump with patch applied

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #17 from Bill Schmidt  ---
Though as I look at it, the "p" field is undefined in Alan's test.  Let me fix
that and see what we get.

[Bug tree-optimization/70130] [6 Regression] h264ref fails with verification error starting with r231674

2016-04-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70130

--- Comment #18 from Bill Schmidt  ---
Never mind, it would get zero initialization, and specifying that directly
doesn't help.

[Bug c++/70641] [5/6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

--- Comment #3 from Jakub Jelinek  ---
Created attachment 38254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38254&action=edit
gcc6-pr70641.patch

Untested fix.

[Bug tree-optimization/70623] [4.9/5/6 Regression] ICE in compute_antic at -O2

2016-04-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70623

--- Comment #6 from Richard Biener  ---
"Patch" in testing.  Note that the issue seems to be oscillating values because
of bitmap_set_and only taking expressions from 'dest', pruning out those
for which the value-and removed their value.  But

mem_ref<0B>,addr_expr<&av>}@.MEM_5 (0005)
mem_ref<0B>,av.0_8}@.MEM_7(D) (0006)
_9 (0006)

and with only 0006 in the value-and but mem_ref<0B>,av.0_8}@.MEM_7(D) (0006)
in the expr-set we get 0006 dropped in clean ().  In a different iteration
mem_ref<0B>,av.0_8}@.MEM_7(D) gets exchanged for _9 (0006) and it re-appears.

The solution seems to be to union the expr-sets in bitmap_set_and before
pruning expressions no longer in the value-intersection.

But then clean () uses bitmap_remove_from_set which does

  unsigned int val  = get_expr_value_id (expr);
  if (!value_id_constant_p (val))
{ 
  bitmap_clear_bit (&set->values, val);
  bitmap_clear_bit (&set->expressions, get_expression_id (expr));
}

and thus seems to rely on there being exactly one expression for each value
in a bitmap-set.  bitmap_find_leader does

  if (bitmap_set_contains_value (set, val))
{
  unsigned int i;
  bitmap_iterator bi;
  bitmap exprset = value_expressions[val];

  EXECUTE_IF_AND_IN_BITMAP (exprset, &set->expressions, 0, i, bi)
return expression_for_id (i);

so kind-of would agree with that.

[Bug ada/70645] New: [4.9/5/6 Regression] -fguess-branch-probability breaks debug-information, only in Ada

2016-04-13 Thread demoonlit at panathenaia dot halfmoon.jp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70645

Bug ID: 70645
   Summary: [4.9/5/6 Regression] -fguess-branch-probability breaks
debug-information, only in Ada
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
  Assignee: unassigned at gcc dot gnu.org
  Reporter: demoonlit at panathenaia dot halfmoon.jp
  Target Milestone: ---

I can not debug some executable files generated by recent gcc Ada frontend,
with all optimization-levels including -fguess-branch-probability.
(I'm troubled with -Og. I've understood that -Og is intended to debug.)

gcc-4.9, gcc-5, and gcc-6 have failed.
However, gcc-4.8 works well.

C/C++ and Fortran frontends work well on all versions.

Note, I tried gdb from 7.9 to 7.11 as debugger.

% cat hello.adb
with Ada.Text_IO;
procedure Hello is
begin
   Ada.Text_IO.Put_Line ("Hello.");
end Hello;

% gcc -v
gcc (GCC) 6.0.0 20160401 (experimental)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% gnatmake -g -Og hello
gcc -c -g -Og hello.adb
gnatbind -x hello.ali
gnatlink hello.ali -g -Og

% gdb hello 
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10.8.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello...Reading symbols from
hello.dSYM/Contents/Resources/DWARF/hello...done.
done.
(gdb) start
Temporary breakpoint 1 at 0x114f1
Starting program: hello 

Temporary breakpoint 1, 0x000114f1 in hello ()
(gdb) s
Single stepping until exit from function _ada_hello,
which has no line number information. #  Please look here 
Hello.
main (argc=, argv=, envp=)
at b~hello.adb:197
197   adafinal;
(gdb) quit
A debugging session is active.

Inferior 1 [process 45663] will be killed.

Quit anyway? (y or n) y

% gnatmake -f -g -Og -fno-guess-branch-probability hello
gcc -c -g -Og -fno-guess-branch-probability hello.adb
gnatbind -x hello.ali
gnatlink hello.ali -g -Og -fno-guess-branch-probability

% gdb hello 
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10.8.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello...Reading symbols from
hello.dSYM/Contents/Resources/DWARF/hello...done.
done.
(gdb) start
Temporary breakpoint 1 at 0x1154e: file hello.adb, line 2.
Starting program: hello 

Temporary breakpoint 1, _ada_hello () at hello.adb:2
2   procedure Hello is
(gdb) s
4  Ada.Text_IO.Put_Line ("Hello."); #  It works fine.
(gdb) s
ada__text_io__put_line__2 (item=...) at a-textio.adb:1424
1424   procedure Put_Line (Item : String) is
(gdb) quit
A debugging session is active.

Inferior 1 [process 45704] will be killed.

Quit anyway? (y or n) y


#  Example of gcc-4.8 from here: 


% gcc --version
gcc (GCC) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% gnatmake -f -g -Og hello
gcc -c -g -Og hello.adb
gnatbind -x hello.ali
gnatlink hello.ali -g -Og

% gdb hello   
GNU gdb (GDB) 7.11
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10.8.0".
Type "show con

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70639

--- Comment #4 from Marek Polacek  ---
So I think rather this one:

--- a/gcc/c-family/c-indentation.c
+++ b/gcc/c-family/c-indentation.c
@@ -239,10 +239,11 @@ should_warn_for_misleading_indentation (const
token_indent_info &guard_tinfo,
   if (line_table->seen_line_directive)
 return false;

-  /* We can't usefully warn about do-while statements since the bodies of
these
- statements are always explicitly delimited at both ends, so control flow
is
- quite obvious.  */
-  if (guard_tinfo.keyword == RID_DO)
+  /* We can't usefully warn about do-while and switch statements since the
+ bodies of these statements are always explicitly delimited at both ends,
+ so control flow is quite obvious.  */
+  if (guard_tinfo.keyword == RID_DO
+  || guard_tinfo.keyword == RID_SWITCH)
 return false;

   /* If the token following the body is a close brace or an "else"

[Bug c++/70615] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in add_expr, at tree.c:7870

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70615

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Wed Apr 13 14:33:53 2016
New Revision: 234940

URL: https://gcc.gnu.org/viewcvs?rev=234940&root=gcc&view=rev
Log:
PR c++/70615
* cp-gimplify.c (cp_genericize_r): Expand PTRMEM_CST here.
(cp_gimplify_expr): Not here.

Added:
trunk/gcc/testsuite/g++.dg/opt/ptrmem7.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-gimplify.c

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #33 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 14:45:46 2016
New Revision: 234942

URL: https://gcc.gnu.org/viewcvs?rev=234942&root=gcc&view=rev
Log:
PR c++/70594
* decl.c (pop_labels_1): Removed.
(note_label, sort_labels): New functions.
(pop_labels): During named_labels traversal, just push the slot
pointers into a vector, then qsort it by DECL_UID and only then
call pop_label and chain it into BLOCK_VARS.

Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c

[Bug c++/70634] [4.9/5/6 Regression] ICE on valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70634

--- Comment #3 from Jason Merrill  ---
Author: jason
Date: Wed Apr 13 15:02:23 2016
New Revision: 234945

URL: https://gcc.gnu.org/viewcvs?rev=234945&root=gcc&view=rev
Log:
PR c++/70634

* pt.c (instantiation_dependent_uneval_expression_p): Split out
from instantiation_dependent_expression_p.
(value_dependent_expression_p): Use it for unevaluated operands.
(instantiation_dependent_r): Don't check value-dependence.
(instantiation_dependent_expression_p): Check
value-dependence of the expression as a whole.
* cp-tree.h: Declare instantiation_dependent_uneval_expression_p.
* semantics.c (finish_decltype_type): Use it.

Added:
trunk/gcc/testsuite/g++.dg/template/dependent-expr10.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c

[Bug fortran/67039] Documentation of pseudorandom number intrinsics is incorrect

2016-04-13 Thread dominiq at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67039

--- Comment #8 from dominiq at gcc dot gnu.org ---
Author: dominiq
Date: Wed Apr 13 15:04:57 2016
New Revision: 234946

URL: https://gcc.gnu.org/viewcvs?rev=234946&root=gcc&view=rev
Log:
2016-04-13  Dominique d'Humieres  

PR fortran/67039
* intrinsic.texi: Correct the documentation of pseudorandom
number intrinsics.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/intrinsic.texi

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread jpoimboe at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #2 from Josh Poimboeuf  ---
$ gcc -Wp,-MD,drivers/scsi/qla2xxx/.qla_attr.o.d  -nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/include -I./arch/x86/include
-Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  -Iinclude
-I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi
-Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Wall
-Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
-Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -mno-sse
-mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1
-mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup
-mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time
-maccumulate-outgoing-args -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1
-DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1
-DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1
-DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare
-fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Os
-Wno-maybe-uninitialized --param=allow-store-data-races=0
-Wframe-larger-than=2048 -fno-stack-protector -Wno-unused-but-set-variable
-fno-omit-frame-pointer -fno-optimize-sibling-calls
-fno-var-tracking-assignments -fno-inline-functions-called-once
-Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow
-fconserve-stack -Werror=implicit-int -Werror=strict-prototypes
-Werror=date-time -Werror=incompatible-pointer-types -DCC_HAVE_ASM_GOTO   
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(qla_attr)" 
-D"KBUILD_MODNAME=KBUILD_STR(qla2xxx)" -c -o drivers/scsi/qla2xxx/qla_attr.o
drivers/scsi/qla2xxx/qla_attr.c

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--disable-libgcj --with-default-libstdcxx-abi=gcc4-compatible --with-isl
--enable-libmpx --enable-gnu-indirect-function --with-tune=generic
--with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC)

[Bug tree-optimization/70604] switch statement optimization creates dead code

2016-04-13 Thread jpoimboe at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70604

Josh Poimboeuf  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #4 from Josh Poimboeuf  ---
Richard, just realized you weren't on CC for my response to your question.

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread jpoimboe at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #1 from Josh Poimboeuf  ---
Created attachment 38256
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38256&action=edit
Linux kernel config

[Bug c/70646] New: Corrupt truncated function

2016-04-13 Thread jpoimboe at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

Bug ID: 70646
   Summary: Corrupt truncated function
   Product: gcc
   Version: 5.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jpoimboe at redhat dot com
  Target Milestone: ---

Created attachment 38255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38255&action=edit
qla_attr.i.gz

The linux kernel has a new tool named "objtool" which follows all possible code
paths for every .o file, looking for abnormalities.  In one rare case it has
discovered a corrupt truncated function.

From the disassembly of drivers/scsi/qla2xxx/qla_attr.o:

2f53 :
2f53:   55  push   %rbp
2f54:   48 89 e5mov%rsp,%rbp

2f57 :
2f57:   55  push   %rbp
2f58:   b9 e8 00 00 00  mov$0xe8,%ecx
2f5d:   48 89 e5mov%rsp,%rbp
...

Note that qla2x00_get_host_fabric_name() is inexplicably truncated after
setting up the frame pointer.  It falls through to the next function, which is
very bad.

I can recreate it with gcc 5.3.1 or gcc 6.0 on the upstream Linux kernel at tag
v4.6-rc3.

The call chain which appears to trigger the problem is:

qla2x00_get_host_fabric_name()
  wwn_to_u64()
get_unaligned_be64()
  be64_to_cpup()
__be64_to_cpup()

It occurs with the combination of the following two recent Linux commits:

- bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining of some
byteswap operations")
- ef3fb2422ffe ("scsi: fc: use get/put_unaligned64 for wwn access")


The gzipped .i file is attached.  I'll also attach the kernel .config file.

[Bug c++/70615] [6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu in add_expr, at tree.c:7870

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70615

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #5 from Jason Merrill  ---
Fixed.

[Bug c++/58822] Segfault when calling make_shared

2016-04-13 Thread michi at triodia dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58822

--- Comment #30 from Michi Henning  ---
(In reply to Jonathan Wakely from comment #29)
> > make_shared(args) doesn't always do the same thing as shared_ptr(new
> > T(args))
> 
> It does do effectively the same thing. The difference in behaviour is
> because when you use shared_ptr(new T(this)) the implicit cast happens
> inside the class, and the compiler can resolve it without inspecting the
> stable.

Yes, I understand why it happens, and why the current behavior conforms to the
standard. It's just that, from an application programmer's point of view, this
is in the "ultra-unexpected category".

> It should be possible to add a warning for the case where the cast happens
> inside the class (which doesn't crash, but is still UB) but it won't be
> possible to warn for the other cases, because at the site of the implicit
> cast the compiler doesn't know whether the pointer refers to a constructed
> object or not. I've created PR 70644.

Most sterling, thank you!

Michi.

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #34 from Jason Merrill  ---
(In reply to Jakub Jelinek from comment #33)
>   (pop_labels): During named_labels traversal, just push the slot
>   pointers into a vector, then qsort it by DECL_UID and only then
>   call pop_label and chain it into BLOCK_VARS.

Tobias, does this fix your testcase?

[Bug fortran/67039] Documentation of pseudorandom number intrinsics is incorrect

2016-04-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67039

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #9 from Dominique d'Humieres  ---
Jerry,

Thanks for the review.

> I think this word should be singular. 
> > +@code{RANDOM_SEED} to initialize the pseudo-random numbers <= no 's'

Done, closing as FIXED.

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70627

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug testsuite/70150] Additonal test failures with --enable-default-pie

2016-04-13 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70150

--- Comment #14 from H.J. Lu  ---
(In reply to psturm from comment #13)
> (In reply to H.J. Lu from comment #12)
> > Patches are posted at
> > 
> > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html
> > https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00995.html
> 
> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00929.html patch does not
> apply because it appears it conflicts with another change made for HPPA:

Please try patches on hjl/pr70150 branch.

[Bug c++/70634] [4.9/5 Regression] ICE on valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70634

Jason Merrill  changed:

   What|Removed |Added

Summary|[4.9/5/6 Regression] ICE on |[4.9/5 Regression] ICE on
   |valid code on   |valid code on
   |x86_64-linux-gnu:   |x86_64-linux-gnu:
   |Segmentation fault (program |Segmentation fault (program
   |cc1plus)|cc1plus)

--- Comment #4 from Jason Merrill  ---
Fixed for GCC 6 so far.

[Bug c/70436] [4.9/5/6 Regression] -Wparentheses missing ambiguous else warning

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436

--- Comment #16 from Marek Polacek  ---
Author: mpolacek
Date: Wed Apr 13 16:00:52 2016
New Revision: 234949

URL: https://gcc.gnu.org/viewcvs?rev=234949&root=gcc&view=rev
Log:
PR c/70436
* c-parser.c (c_parser_statement_after_labels): Add IF_P argument and
adjust callers.
(c_parser_statement): Likewise.
(c_parser_c99_block_statement): Likewise.
(c_parser_while_statement): Likewise.
(c_parser_for_statement): Likewise.
(c_parser_if_body): Don't set IF_P here.
(c_parser_if_statement): Add IF_P argument.  Set IF_P here.  Warn
about dangling else here.
* c-tree.h (c_finish_if_stmt): Adjust declaration.
* c-typeck.c (c_finish_if_stmt): Remove NESTED_IF parameter.  Don't
warn about dangling else here.

* testsuite/gcc.dg/Wparentheses-12.c: New test.
* testsuite/gcc.dg/Wparentheses-13.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/Wparentheses-12.c
trunk/gcc/testsuite/gcc.dg/Wparentheses-13.c
Modified:
trunk/gcc/c/ChangeLog
trunk/gcc/c/c-parser.c
trunk/gcc/c/c-tree.h
trunk/gcc/c/c-typeck.c
trunk/gcc/testsuite/ChangeLog

[Bug c/70436] [4.9/5/6 Regression] -Wparentheses missing ambiguous else warning

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #17 from Marek Polacek  ---
Should be fixed now.

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70639

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2016-04-13
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70639

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #6 from Marek Polacek  ---
Fixed.

[Bug c++/70639] internal compiler error: in guard_tinfo_to_string, at c-family/c-indentation.c:560

2016-04-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70639

--- Comment #5 from Marek Polacek  ---
Author: mpolacek
Date: Wed Apr 13 16:28:46 2016
New Revision: 234952

URL: https://gcc.gnu.org/viewcvs?rev=234952&root=gcc&view=rev
Log:
PR c++/70639
* c-indentation.c (should_warn_for_misleading_indentation): Bail out
for switch statements, too.

* c-c++-common/Wmisleading-indentation-4.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/Wmisleading-indentation-4.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-indentation.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/70461] [6 Regression] Performance regression after r234527

2016-04-13 Thread afomin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70461

Alexander Fomin  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #6 from Alexander Fomin  ---
Please consider my previous comment irrelevant.
I close this one, thanks.

[Bug c++/70635] [4.9/5/6 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-13 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70635

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Wed Apr 13 17:11:03 2016
New Revision: 234953

URL: https://gcc.gnu.org/viewcvs?rev=234953&root=gcc&view=rev
Log:
/cp
2016-04-13  Paolo Carlini  

PR c++/70635
* pt.c (resolve_typename_type): Fix typos in infinite recursion
avoidance mechanism.

/testsuite
2016-04-13  Paolo Carlini  

PR c++/70635
* g++.dg/parse/pr70635.C: New.

Added:
trunk/gcc/testsuite/g++.dg/parse/pr70635.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/70635] [4.9/5 Regression] ICE on (and rejects) valid code on x86_64-linux-gnu: Segmentation fault (program cc1plus)

2016-04-13 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70635

Paolo Carlini  changed:

   What|Removed |Added

Summary|[4.9/5/6 Regression] ICE on |[4.9/5 Regression] ICE on
   |(and rejects) valid code on |(and rejects) valid code on
   |x86_64-linux-gnu:   |x86_64-linux-gnu:
   |Segmentation fault (program |Segmentation fault (program
   |cc1plus)|cc1plus)

--- Comment #5 from Paolo Carlini  ---
Fixed in trunk so far.

[Bug bootstrap/70173] make distclean: leaves stage_final and libcc1/compiler-name.h

2016-04-13 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70173

--- Comment #7 from Segher Boessenkool  ---
Author: segher
Date: Wed Apr 13 18:02:08 2016
New Revision: 234954

URL: https://gcc.gnu.org/viewcvs?rev=234954&root=gcc&view=rev
Log:
Make distclean clean up more (PR70173)

Currently, distclean does not remove the libcc1, gnattools, and gotools
directories, and not the stage_final file either.  Fix that.


PR bootstrap/70173
* Makefile.tpl (local-distclean): Delete the libcc1, gnattools,
and gotools directories.  Delete the stage_final file.
* Makefile.in: Regenerate.

Modified:
trunk/ChangeLog
trunk/Makefile.in
trunk/Makefile.tpl

[Bug target/65344] Exception is not catched on AIX - class with more ancestors, virtual method throws

2016-04-13 Thread jezz at hkfree dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65344

Miroslav Jezbera  changed:

   What|Removed |Added

Version|4.8.3   |5.3.1

--- Comment #1 from Miroslav Jezbera  ---
Reproduced also in version 5.3.1.

[Bug rtl-optimization/68749] FAIL: gcc.dg/ifcvt-4.c scan-rtl-dump ce1 "2 true changes made"

2016-04-13 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68749

--- Comment #8 from Rainer Orth  ---
Author: ro
Date: Wed Apr 13 18:13:31 2016
New Revision: 234955

URL: https://gcc.gnu.org/viewcvs?rev=234955&root=gcc&view=rev
Log:
Fix gcc.dg/ifcvt-4.c on 64-bit SPARC (PR rtl-optimization/68749)

PR rtl-optimization/68749
* gcc.dg/ifcvt-4.c: Use "word_mode" rather than "int" to limit the
effects of argument promotions.
Remove default args to dg-skip-if.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/ifcvt-4.c

[Bug rtl-optimization/68749] FAIL: gcc.dg/ifcvt-4.c scan-rtl-dump ce1 "2 true changes made"

2016-04-13 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68749

--- Comment #9 from Rainer Orth  ---
SPARC V9 part fixed for 6.1.

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70627

--- Comment #8 from Jason Merrill  ---
Author: jason
Date: Wed Apr 13 18:32:11 2016
New Revision: 234956

URL: https://gcc.gnu.org/viewcvs?rev=234956&root=gcc&view=rev
Log:
PR c++/70627

* decl.c (start_enum): Don't change an existing ENUM_UNDERLYING_TYPE.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/enum_base3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c

[Bug c++/70627] [6 Regression] internal compiler error: verify_type failed

2016-04-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70627

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #9 from Jason Merrill  ---
Fixed.

[Bug target/70568] [4.9/5/6 regression] PowerPC64: union of floating and fixed doesn't use POWER8 GPR/VSR moves

2016-04-13 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70568

acsawdey at gcc dot gnu.org changed:

   What|Removed |Added

 CC||vmakarov at gcc dot gnu.org
Summary|PowerPC64: union of |[4.9/5/6 regression]
   |floating and fixed doesn't  |PowerPC64: union of
   |use POWER8 GPR/VSR moves|floating and fixed doesn't
   ||use POWER8 GPR/VSR moves

--- Comment #3 from acsawdey at gcc dot gnu.org ---
Tracked this back to 210824, and in particular this change:

@@ -860,10 +897,15 @@
}
}

- /* If the alternative actually allows memory, make
-things a bit cheaper since we won't need an extra
-insn to load it.  */
- if (op_class != NO_REGS)
+ if (op_class == NO_REGS)
+   /* Although we don't need insn to reload from
+  memory, still accessing memory is usually more
+  expensive than a register.  */
+   pp->mem_cost = frequency;
+ else
+   /* If the alternative actually allows memory, make
+  things a bit cheaper since we won't need an
+  extra insn to load it.  */
pp->mem_cost
  = ((out_p ? ira_memory_move_cost[mode][op_class][0] : 0)
 + (in_p ? ira_memory_move_cost[mode][op_class][1] : 0)

Without this change, you get this from IRA costs:

a0 (r157,l0) best GENERAL_REGS, allocno GENERAL_REGS
a0(r157,l0) costs: BASE_REGS:4000,4000 GENERAL_REGS:4000,4000
LINK_REGS:16000,16000 CTR_REGS:16000,16000 LINK_OR_CTR_REGS:16000,16000
SPEC_OR_GEN_REGS:16000,16000 MEM:4000,4000

and we pick the pattern for xscvdpspn. 

With the change, you get

a0 (r157,l0) best NO_REGS, allocno NO_REGS
a0(r157,l0) costs: BASE_REGS:3000,3000 GENERAL_REGS:3000,3000
LINK_REGS:15000,15000 CTR_REGS:15000,15000 LINK_OR_CTR_REGS:15000,15000
SPEC_OR_GEN_REGS:15000,15000 MEM:2000,2000

And this gets done via memory instead of the register moves.

[Bug testsuite/68242] FAIL: libgomp.oacc-c-c++-common/reduction-2.c, and other OpenACC reduction test case "oddities"

2016-04-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68242

--- Comment #7 from cesar at gcc dot gnu.org ---
Author: cesar
Date: Wed Apr 13 18:54:41 2016
New Revision: 234957

URL: https://gcc.gnu.org/viewcvs?rev=234957&root=gcc&view=rev
Log:
libgomp/
PR testsuite/68242
* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Adjust test.
* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.


Modified:
trunk/libgomp/ChangeLog
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-1.c
trunk/libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-2.c

[Bug testsuite/68242] FAIL: libgomp.oacc-c-c++-common/reduction-2.c, and other OpenACC reduction test case "oddities"

2016-04-13 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68242

cesar at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #8 from cesar at gcc dot gnu.org ---
Fixed in r234957.

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread vda.linux at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

Denis Vlasenko  changed:

   What|Removed |Added

 CC||vda.linux at googlemail dot com

--- Comment #3 from Denis Vlasenko  ---
I can reproduce it with:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/5.3.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) 

No fancy compiler flags are necessary to thigger it.

Without "-fno-omit-frame-pointer", function loses its two remaining insns, I
see an empty body:

.type   qla2x00_get_host_fabric_name, @function
qla2x00_get_host_fabric_name:
.LFB4504:
.cfi_startproc
.cfi_endproc
.LFE4504:
.size   qla2x00_get_host_fabric_name, .-qla2x00_get_host_fabric_name

Simple "gcc -Os qla_attr.i.c -S" would do.

gcc -O2 produces a normally-looking function.

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread vda.linux at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #4 from Denis Vlasenko  ---
Shorter reproducer:

typedef __signed__ char __s8;
typedef unsigned char __u8;
typedef __signed__ short __s16;
typedef unsigned short __u16;
typedef __signed__ int __s32;
typedef unsigned int __u32;
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
typedef signed char s8;
typedef unsigned char u8;
typedef signed short s16;
typedef unsigned short u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
typedef __u64 __be64;
static inline __attribute__((no_instrument_function))
__attribute__((__const__)) __u64 __fswab64(__u64 val)
{
 return __builtin_bswap64(val);
}
static inline __attribute__((no_instrument_function))
__attribute__((always_inline)) __u64 __swab64p(const __u64 *p)
{
 return (__builtin_constant_p((__u64)(*p)) ? ((__u64)( (((__u64)(*p) &
(__u64)0x00ffULL) << 56) | (((__u64)(*p) &
(__u64)0xff00ULL) << 40) | (((__u64)(*p) &
(__u64)0x00ffULL) << 24) | (((__u64)(*p) &
(__u64)0xff00ULL) << 8) | (((__u64)(*p) &
(__u64)0x00ffULL) >> 8) | (((__u64)(*p) &
(__u64)0xff00ULL) >> 24) | (((__u64)(*p) &
(__u64)0x00ffULL) >> 40) | (((__u64)(*p) &
(__u64)0xff00ULL) >> 56))) : __fswab64(*p));
}
static inline __attribute__((no_instrument_function))
__attribute__((always_inline)) __u64 __be64_to_cpup(const __be64 *p)
{
 return __swab64p((__u64 *)p);
}
static inline __attribute__((no_instrument_function))
__attribute__((always_inline)) u64 get_unaligned_be64(const void *p)
{
 return __be64_to_cpup((__be64 *)p);
}
static inline __attribute__((no_instrument_function)) u64 wwn_to_u64(u8 *wwn)
{
 return get_unaligned_be64(wwn);
}

struct Scsi_Host {
 unsigned long base;
 unsigned long io_port;
 unsigned char n_io_port;
 unsigned char dma_channel;
 unsigned int irq;
 void *shost_data;
 unsigned long hostdata[0]
  __attribute__ ((aligned (sizeof(unsigned long;
};
static inline __attribute__((no_instrument_function)) void *shost_priv(struct
Scsi_Host *shost)
{
 return (void *)shost->hostdata;
}
typedef struct scsi_qla_host {
 u8 fabric_node_name[8];
 u32 device_flags;
} scsi_qla_host_t;
struct fc_host_attrs {
 u64 node_name;
 u64 port_name;
 u64 permanent_port_name;
 u32 supported_classes;
 u8 supported_fc4s[32];
 u32 supported_speeds;
 u32 maxframe_size;
 u16 max_npiv_vports;
 char serial_number[80];
 char manufacturer[80];
 char model[256];
 char model_description[256];
 char hardware_version[64];
 char driver_version[64];
 char firmware_version[64];
 char optionrom_version[64];
 u32 port_id;
 u8 active_fc4s[32];
 u32 speed;
 u64 fabric_name;
};

static void
qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
{
 scsi_qla_host_t *vha = shost_priv(shost);
 u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF};
 u64 fabric_name = wwn_to_u64(node_name);

 if (vha->device_flags & 0x1)
  fabric_name = wwn_to_u64(vha->fabric_node_name);

 (((struct fc_host_attrs *)(shost)->shost_data)->fabric_name) = fabric_name;
}

void *get_host_fabric_name = qla2x00_get_host_fabric_name;

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread vda.linux at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #5 from Denis Vlasenko  ---
Even smaller reproducer.

Bug disappears if "__attribute__((always_inline))" is removed everywhere.


typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned long long u64;
static inline __attribute__((__const__)) u64 __fswab64(u64 val)
{
 return __builtin_bswap64(val);
}
static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
{
 return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) &
(u64)0x00ffULL) << 56) | (((u64)(*p) & (u64)0xff00ULL)
<< 40) | (((u64)(*p) & (u64)0x00ffULL) << 24) | (((u64)(*p) &
(u64)0xff00ULL) << 8) | (((u64)(*p) & (u64)0x00ffULL)
>> 8) | (((u64)(*p) & (u64)0xff00ULL) >> 24) | (((u64)(*p) &
(u64)0x00ffULL) >> 40) | (((u64)(*p) & (u64)0xff00ULL)
>> 56))) : __fswab64(*p));
}
static inline __attribute__((always_inline)) u64 __be64_to_cpup(const u64 *p)
{
 return __swab64p((u64 *)p);
}
static inline __attribute__((always_inline)) u64 get_unaligned_be64(const void
*p)
{
 return __be64_to_cpup((u64 *)p);
}
static inline u64 wwn_to_u64(u8 *wwn)
{
 return get_unaligned_be64(wwn);
}

struct Scsi_Host {
 void *shost_data;
 unsigned long hostdata[0];
};
static inline void *shost_priv(struct Scsi_Host *shost)
{
 return (void *)shost->hostdata;
}
typedef struct scsi_qla_host {
 u8 fabric_node_name[8];
 u32 device_flags;
} scsi_qla_host_t;
struct fc_host_attrs {
 u64 fabric_name;
};

static void
qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
{
 scsi_qla_host_t *vha = shost_priv(shost);
 u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
 u64 fabric_name = wwn_to_u64(node_name);
 if (vha->device_flags & 0x1)
  fabric_name = wwn_to_u64(vha->fabric_node_name);
 (((struct fc_host_attrs *)(shost)->shost_data)->fabric_name) = fabric_name;
}

void *get_host_fabric_name = qla2x00_get_host_fabric_name;

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread vda.linux at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

--- Comment #6 from Denis Vlasenko  ---
I can collapse the chain of inlines down to this and still see the bug.
Removing "__attribute__((always_inline))", or merging __swab64p() and
wwn_to_u64(), makes bug disappear.


typedef unsigned char u8;
typedef unsigned int u32;
typedef unsigned long long u64;
static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
{
 return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) &
(u64)0x00ffULL) << 56) | (((u64)(*p) & (u64)0xff00ULL)
<< 40) | (((u64)(*p) & (u64)0x00ffULL) << 24) | (((u64)(*p) &
(u64)0xff00ULL) << 8) | (((u64)(*p) & (u64)0x00ffULL)
>> 8) | (((u64)(*p) & (u64)0xff00ULL) >> 24) | (((u64)(*p) &
(u64)0x00ffULL) >> 40) | (((u64)(*p) & (u64)0xff00ULL)
>> 56))) : __builtin_bswap64(*p));
}
static inline u64 wwn_to_u64(void *wwn)
{
 return __swab64p(wwn);
}

struct Scsi_Host {
 void *shost_data;
 unsigned long hostdata[0];
};
static inline void *shost_priv(struct Scsi_Host *shost)
{
 return (void *)shost->hostdata;
}
typedef struct scsi_qla_host {
 u8 fabric_node_name[8];
 u32 device_flags;
} scsi_qla_host_t;
struct fc_host_attrs {
 u64 fabric_name;
};

static void
qla2x00_get_host_fabric_name(struct Scsi_Host *shost)
{
 scsi_qla_host_t *vha = shost_priv(shost);
 u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
 u64 fabric_name = wwn_to_u64(node_name);
 if (vha->device_flags & 0x1)
  fabric_name = wwn_to_u64(vha->fabric_node_name);
 (((struct fc_host_attrs *)(shost)->shost_data)->fabric_name) = fabric_name;
}

void *get_host_fabric_name = qla2x00_get_host_fabric_name;

[Bug c++/70647] New: Feature request: warning for self-moving in constructors

2016-04-13 Thread matt at godbolt dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647

Bug ID: 70647
   Summary: Feature request: warning for self-moving in
constructors
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: matt at godbolt dot org
  Target Milestone: ---

Consider the following code:

#include  // for std::move
struct A {
  int a; int b;

  A(A &&o) 
: a(a), // I get a warning here...
  b(o.b) {}  
};
struct B { 
  int a; int b; 
  B(B &&o) 
: a(std::move(a)),  // but sadly not here
  b(std::move(o.b)) {}
};

[ c.f https://godbolt.org/g/v7zPYL ]

In the non-moving case, I get a warning that I've typoed and assigned a with
itself.

In the move case, there's no such warning. I appreciate this is probably
difficult (if not impossible) to detect, but if there's any way it can be done,
it would save a painful debugging session or two!

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #35 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 20:35:59 2016
New Revision: 234961

URL: https://gcc.gnu.org/viewcvs?rev=234961&root=gcc&view=rev
Log:
PR c++/70594
* tree-sra.c (create_access_replacement,
get_replaced_param_substitute): Set DECL_NAMELESS on repl if it
gets fancy name.
* tree-pretty-print.c (dump_fancy_name): New function.
(dump_decl_name, dump_generic_node): Use it.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-pretty-print.c
trunk/gcc/tree-sra.c

[Bug c++/70641] [5/6 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Wed Apr 13 20:43:10 2016
New Revision: 234962

URL: https://gcc.gnu.org/viewcvs?rev=234962&root=gcc&view=rev
Log:
PR c++/70641
* ipa-pure-const.c (pass_nothrow::execute): Call maybe_clean_eh_stmt
on all recursive call stmts.  Return TODO_cleanup_cfg if any dead
eh edges have been purged.

* g++.dg/opt/pr70641.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr70641.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-pure-const.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/70594] [6 Regression] -fcompare-debug failure

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70594

--- Comment #36 from Jakub Jelinek  ---
Tobias said he still sees some -fcompare-debug issue even with both of these
patches, so not closing this yet.

[Bug c++/70641] [5 Regression] ICE on valid code at -O1 and above on x86_64-linux-gnu: verify_gimple failed

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70641

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
Summary|[5/6 Regression] ICE on |[5 Regression] ICE on valid
   |valid code at -O1 and above |code at -O1 and above on
   |on x86_64-linux-gnu:|x86_64-linux-gnu:
   |verify_gimple failed|verify_gimple failed

--- Comment #5 from Jakub Jelinek  ---
Should be fixed on the trunk so far.

[Bug c++/70648] New: [6 Regression] adplug-xmms fails to compile

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70648

Bug ID: 70648
   Summary: [6 Regression] adplug-xmms fails to compile
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: jason at gcc dot gnu.org
  Target Milestone: ---

template  struct C
{
  template 
  constexpr C (...) : c { static_cast(0)... } {}
  constexpr const V &operator[](T) { return c[0]; }
  V c[T::F];
};
enum D { E, F };
struct A
{
  struct G
  {
typedef int *H;
int g, h;
C i;
constexpr G () : g (), h (), i{} {}
constexpr G foo (H) { return G (0, 0, 0, 0, i[E]); }
constexpr G (int, int, H, H, H) : g (), h (), i{} {}
  };
};
struct B : A
{
  static constexpr auto b = G ().foo (0);
};

fails to compile with -std=c++11, starting with r234013.  No idea whether the
error is valid or not, and perhaps the reduced testcase also doesn't exactly
match the original, I've been reducing on accepted by r234009, rejected by
r234013.

[Bug c++/70648] [6 Regression] adplug-xmms fails to compile

2016-04-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70648

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|--- |6.0

[Bug c++/19808] miss a warning about uninitialized member usage in member initializer list in constructor

2016-04-13 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808

Manuel López-Ibáñez  changed:

   What|Removed |Added

 CC||matt at godbolt dot org

--- Comment #30 from Manuel López-Ibáñez  ---
*** Bug 70647 has been marked as a duplicate of this bug. ***

[Bug c++/70647] Feature request: warning for self-moving in constructors

2016-04-13 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70647

Manuel López-Ibáñez  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||manu at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #1 from Manuel López-Ibáñez  ---
(In reply to Matt Godbolt from comment #0)
> In the move case, there's no such warning. I appreciate this is probably
> difficult (if not impossible) to detect, but if there's any way it can be
> done, it would save a painful debugging session or two!

I don't think "move" has anything to do with this. If you use "a + 1" or
"foo(a)", you are still initializing "a" with an uninitialized value.

In that sense, this is what PR19808 is about, for which there is a patch but,
sadly, nobody has had so far the time or interest to finish it and properly
submit it.

*** This bug has been marked as a duplicate of bug 19808 ***

[Bug c/70646] Corrupt truncated function

2016-04-13 Thread mednafen at sent dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70646

mednafen at sent dot com changed:

   What|Removed |Added

 CC||mednafen at sent dot com

--- Comment #7 from mednafen at sent dot com ---
Following code aborts on x86_64 4.9.2 and 5.3.0 at -O2, at least:

#pragma GCC optimize("no-unit-at-a-time")

typedef unsigned char u8;
typedef unsigned long long u64;

static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
{
 return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) &
(u64)0x00ffULL) << 56) | (((u64)(*p) & (u64)0xff00ULL)
<< 40) | (((u64)(*p) & (u64)0x00ffULL) << 24) | (((u64)(*p) &
(u64)0xff00ULL) << 8) | (((u64)(*p) & (u64)0x00ffULL)
>> 8) | (((u64)(*p) & (u64)0xff00ULL) >> 24) | (((u64)(*p) &
(u64)0x00ffULL) >> 40) | (((u64)(*p) & (u64)0xff00ULL)
>> 56))) : __builtin_bswap64(*p));
}

static inline u64 wwn_to_u64(void *wwn)
{
 return __swab64p(wwn);
}

void __attribute__((noinline,noclone)) broken(u64* shost)
{
 u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
 *shost = wwn_to_u64(node_name);
}

void __attribute__((noinline,noclone)) dummy(void)
{
 __builtin_abort();
}

int main(int argc, char* argv[])
{
 u64 v;

 broken(&v);

 if(v != (u64)-1)
  __builtin_abort();

 return 0;
}

[Bug target/70640] IEEE 128-bit floating point negative/abs has two thinkos

2016-04-13 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70640

Michael Meissner  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #3 from Michael Meissner  ---
Test pr70640 fails on power7 system without power8 assembler.

[Bug c++/69517] [5/6 regression] SEGV on a VLA with excess initializer elements

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69517

--- Comment #9 from Martin Sebor  ---
Author: msebor
Date: Wed Apr 13 23:26:41 2016
New Revision: 234966

URL: https://gcc.gnu.org/viewcvs?rev=234966&root=gcc&view=rev
Log:
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2

gcc/testsuite/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
* g++.dg/cpp1y/vla11.C: New test.
* g++.dg/cpp1y/vla12.C: New test.
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
* gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.

gcc/cp/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
functions.
* decl.c (check_initializer, cp_finish_decl): Call them.
(reshape_init_r): Reject incompletely braced intializer-lists
for VLAs.
* init.c (throw_bad_array_length, build_vla_check)
(build_vla_size_check, build_vla_init_check): Define new functions.
* typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
to detect a VLA.
(store_init_value): Same.

gcc/doc/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* extend.texi (Variable Length): Document C++ specifics.

libstdc++-v3/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
* testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
   upper bound is positive.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/vla11.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla12.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla13.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla14.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/ubsan/vla-1.c
trunk/gcc/testsuite/g++.dg/init/array24.C
trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc

[Bug c++/70588] SIGBUS on a VLA larger than SIZE_MAX / 2

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70588

--- Comment #7 from Martin Sebor  ---
Author: msebor
Date: Wed Apr 13 23:26:41 2016
New Revision: 234966

URL: https://gcc.gnu.org/viewcvs?rev=234966&root=gcc&view=rev
Log:
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2

gcc/testsuite/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
* g++.dg/cpp1y/vla11.C: New test.
* g++.dg/cpp1y/vla12.C: New test.
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
* gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.

gcc/cp/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
functions.
* decl.c (check_initializer, cp_finish_decl): Call them.
(reshape_init_r): Reject incompletely braced intializer-lists
for VLAs.
* init.c (throw_bad_array_length, build_vla_check)
(build_vla_size_check, build_vla_init_check): Define new functions.
* typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
to detect a VLA.
(store_init_value): Same.

gcc/doc/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* extend.texi (Variable Length): Document C++ specifics.

libstdc++-v3/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
* testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
   upper bound is positive.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/vla11.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla12.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla13.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla14.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/ubsan/vla-1.c
trunk/gcc/testsuite/g++.dg/init/array24.C
trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc

[Bug c++/70019] VLA size overflow not detected

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70019

--- Comment #4 from Martin Sebor  ---
Author: msebor
Date: Wed Apr 13 23:26:41 2016
New Revision: 234966

URL: https://gcc.gnu.org/viewcvs?rev=234966&root=gcc&view=rev
Log:
PR c++/69517 - [5/6 regression] SEGV on a VLA with excess initializer elements
PR c++/70019 - VLA size overflow not detected
PR c++/70588 - SIGBUS on a VLA larger than SIZE_MAX / 2

gcc/testsuite/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* c-c++-common/ubsan/vla-1.c (main): Catch exceptions.
* g++.dg/cpp1y/vla11.C: New test.
* g++.dg/cpp1y/vla12.C: New test.
* g++.dg/cpp1y/vla13.C: New test.
* g++.dg/cpp1y/vla14.C: New test.
* g++.dg/cpp1y/vla3.C: Restore deleted test.
* gcc/testsuite/g++.dg/init/array24.C: Fully brace VLA initializer.
* g++.dg/ubsan/vla-1.C: Disable exceptions.

gcc/cp/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* cp-tree.h (throw_bad_array_length, build_vla_check): Declare new
functions.
* decl.c (check_initializer, cp_finish_decl): Call them.
(reshape_init_r): Reject incompletely braced intializer-lists
for VLAs.
* init.c (throw_bad_array_length, build_vla_check)
(build_vla_size_check, build_vla_init_check): Define new functions.
* typeck2.c (split_nonconstant_init_1): Use variably_modified_type_p()
to detect a VLA.
(store_init_value): Same.

gcc/doc/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
PR c++/70019
PR c++/70588
* extend.texi (Variable Length): Document C++ specifics.

libstdc++-v3/ChangeLog:
2016-04-13  Martin Sebor  

PR c++/69517
* testsuite/25_algorithms/rotate/moveable2.cc: Make sure VLA
   upper bound is positive.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/vla11.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla12.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla13.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla14.C
trunk/gcc/testsuite/g++.dg/cpp1y/vla3.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck2.c
trunk/gcc/doc/extend.texi
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/ubsan/vla-1.c
trunk/gcc/testsuite/g++.dg/init/array24.C
trunk/gcc/testsuite/g++.dg/ubsan/vla-1.C
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/testsuite/25_algorithms/rotate/moveable2.cc

[Bug c++/69517] [5 regression] SEGV on a VLA with excess initializer elements

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69517

Martin Sebor  changed:

   What|Removed |Added

  Known to work||4.9.3, 6.0
Summary|[5/6 regression] SEGV on a  |[5 regression] SEGV on a
   |VLA with excess initializer |VLA with excess initializer
   |elements|elements
  Known to fail|6.0 |

--- Comment #10 from Martin Sebor  ---
Fixed in 6.0 by r234966.

[Bug c++/16994] [meta-bug] VLA and C++

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16994
Bug 16994 depends on bug 70019, which changed state.

Bug 70019 Summary: VLA size overflow not detected
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70019

   What|Removed |Added

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

[Bug c++/70019] VLA size overflow not detected

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70019

Martin Sebor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||6.0
 Resolution|--- |FIXED
   Target Milestone|--- |6.0
  Known to fail||5.3.0

--- Comment #5 from Martin Sebor  ---
Fixed in 6.0 by r234966.

[Bug c++/16994] [meta-bug] VLA and C++

2016-04-13 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16994
Bug 16994 depends on bug 70588, which changed state.

Bug 70588 Summary: SIGBUS on a VLA larger than SIZE_MAX / 2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70588

   What|Removed |Added

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

  1   2   >