[Bug tree-optimization/64269] [4.8/4.9/5 Regression] ICE with -O3 enabled on Ubuntu 14.04

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64269

--- Comment #4 from Jakub Jelinek jakub at gcc dot gnu.org ---
Shorter testcase:
void
foo (char *p)
{
  __SIZE_TYPE__ s = ~(__SIZE_TYPE__)0;
  *p = 0;
  __builtin_memset (p + 1, 0, s);
}


[Bug tree-optimization/64269] [4.8/4.9/5 Regression] ICE with -O3 enabled on Ubuntu 14.04

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64269

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org ---
Created attachment 34260
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34260action=edit
gcc5-pr64269.patch

Untested fix.


[Bug c/64279] New: Warning missing for (cond) ? A : A / if(cond) expr1; else expr1; // same expression in if and else branch

2014-12-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64279

Bug ID: 64279
   Summary: Warning missing for (cond) ? A : A / if(cond) expr1;
else expr1; // same expression in if and else branch
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
CC: mpolacek at gcc dot gnu.org

Related to PR63357 but for the branch and not for the condition.

In a real-world code, cppcheck detected: Found duplicate branches for 'if' and
'else'.:

  if (_perimeter = ci.perimeter)
_perimeter  -= ci.perimeter;
  else
_perimeter  -= ci.perimeter;

It would be nice if GCC could also detect those - at least when both branches
consist only of a simple statement - and similarly for (cond) ? a : a.


[Bug lto/64262] [5 Regression] Several LTO failures after r218609.

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64262

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Fixed by r218659.


[Bug rtl-optimization/64255] [5 Regression] failures with -O2 optimization on i = 0 ? (unsigned long) i : - (unsigned long) i

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64255

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Fixed by r218658.


[Bug rtl-optimization/63917] [5 Regression] r217646 caused many failures

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63917

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||trippels at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #11 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Fixed.


[Bug rtl-optimization/64255] [5 Regression] failures with -O2 optimization on i = 0 ? (unsigned long) i : - (unsigned long) i

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64255
Bug 64255 depends on bug 63917, which changed state.

Bug 63917 Summary: [5 Regression] r217646 caused many failures
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63917

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED


[Bug c++/64261] false branch of conditional operator ?: evaluated in a template constexpr

2014-12-12 Thread eugene at hutorny dot in.ua
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64261

--- Comment #2 from Eugene eugene at hutorny dot in.ua ---
-Wall  -pedantic -Os -g -std=c++0x


[Bug middle-end/64246] [5 Regression] ICE building libada for Windows due to NULL loop header

2014-12-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64246

Eric Botcazou ebotcazou at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
   Assignee|rguenth at gcc dot gnu.org |ebotcazou at gcc dot 
gnu.org

--- Comment #2 from Eric Botcazou ebotcazou at gcc dot gnu.org ---
Let me have a look first.


[Bug other/64278] [5 Regression] /sreal.c:254:22: error: call of overloaded 'abs(const int64_t)' is ambiguous

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64278

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||mliska at suse dot cz
   Target Milestone|--- |5.0

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
Martin - please simply use absu_hwi.


[Bug tree-optimization/64277] [4.9/5.0 Regression] Incorrect warning array subscript is above array bounds

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64277

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.9.3


[Bug middle-end/64274] [5.0 Regression][ARM] gcc.target/arm/fixed-point-exec.c ICE in fold_binary_loc

2014-12-12 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64274

--- Comment #2 from ktkachov at gcc dot gnu.org ---
(In reply to Marek Polacek from comment #1)
 Does the following fix it?
 
 diff --git a/gcc/fold-const.c b/gcc/fold-const.c
 index 7b68bea..34f5a6b 100644
 --- a/gcc/fold-const.c
 +++ b/gcc/fold-const.c
 @@ -10082,7 +10082,8 @@ fold_binary_loc (location_t loc,
   /* Reassociate (plus (plus (mult) (foo)) (mult)) as
  (plus (plus (mult) (mult)) (foo)) so that we can
  take advantage of the factoring cases below.  */
 - if (TYPE_OVERFLOW_WRAPS (type)
 + if (ANY_INTEGRAL_TYPE_P (type)
 +  TYPE_OVERFLOW_WRAPS (type)
(((TREE_CODE (arg0) == PLUS_EXPR
 || TREE_CODE (arg0) == MINUS_EXPR)
 TREE_CODE (arg1) == MULT_EXPR)

Yes, thanks. I'll bootstrap this on arm-none-linux-gnueabihf it you'd like


[Bug middle-end/64274] [5.0 Regression][ARM] gcc.target/arm/fixed-point-exec.c ICE in fold_binary_loc

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64274

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
That would even fix a wrong-code bug for unsigned fixed-point types.


[Bug tree-optimization/64280] New: [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

Bug ID: 64280
   Summary: [5 Regression] ICE in replace_uses_by, at
tree-cfg.c:1789
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

Created attachment 34261
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34261action=edit
preprocessed source

 ./cc1plus  -quiet trainer.ii -O
trainer.cpp: In member function 'virtual bool zinnia::TrainerImpl::train(const
char*)':
trainer.cpp:124:6: internal compiler error: in replace_uses_by, at
tree-cfg.c:1789
0xfb5c3d replace_uses_by(tree_node*, tree_node*)
/space/rguenther/src/svn/trunk2/gcc/tree-cfg.c:1789
0xfb61dd gimple_merge_blocks
/space/rguenther/src/svn/trunk2/gcc/tree-cfg.c:1902
0xa64864 merge_blocks(basic_block_def*, basic_block_def*)
/space/rguenther/src/svn/trunk2/gcc/cfghooks.c:760
0xfce6cb cleanup_tree_cfg_bb
/space/rguenther/src/svn/trunk2/gcc/tree-cfgcleanup.c:657
0xfce74a cleanup_tree_cfg_1
/space/rguenther/src/svn/trunk2/gcc/tree-cfgcleanup.c:689
0xfce8a6 cleanup_tree_cfg_noloop
/space/rguenther/src/svn/trunk2/gcc/tree-cfgcleanup.c:747
0xfce9b2 cleanup_tree_cfg()
/space/rguenther/src/svn/trunk2/gcc/tree-cfgcleanup.c:802
0xe79acc execute_function_todo
/space/rguenther/src/svn/trunk2/gcc/passes.c:1893
0xe78d45 do_per_function
/space/rguenther/src/svn/trunk2/gcc/passes.c:1632
0xe79dfc execute_todo
/space/rguenther/src/svn/trunk2/gcc/passes.c:1997
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug tree-optimization/64280] [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug ipa/64281] New: [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64281

Bug ID: 64281
   Summary: [5 Regression] ICE: Segmentation fault
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

Created attachment 34262
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34262action=edit
preprocessed source

 ./cc1plus  -quiet qbtsession.ii   
../../src/qtlibtorrent/qbtsession.cpp: In member function 'QTorrentHandle
QBtSession::addMagnetUri(QString, bool, bool, const QString)':
../../src/qtlibtorrent/qbtsession.cpp:1030:70: warning:
'libtorrent::torrent_handle libtorrent::add_magnet_uri(libtorrent::session,
const string, libtorrent::add_torrent_params)' is deprecated
[-Wdeprecated-declarations]
In file included from ../../src/torrentpersistentdata.h:38:0,
 from ../../src/qtlibtorrent/qbtsession.cpp:53:
/usr/include/libtorrent/magnet_uri.hpp:62:17: note: declared here
../../src/qtlibtorrent/qbtsession.cpp: At global scope:
../../src/qtlibtorrent/qbtsession.cpp:3169:1: internal compiler error:
Segmentation fault
0xf7881a crash_signal
/space/rguenther/src/svn/trunk2/gcc/toplev.c:358
0x6c086d tree_check(tree_node const*, char const*, int, char const*, tree_code)
/space/rguenther/src/svn/trunk2/gcc/tree.h:3023
0xa810a4 symbol_table::decl_assembler_name_hash(tree_node const*)
/space/rguenther/src/svn/trunk2/gcc/symtab.c:78
0xa813b3 symbol_table::insert_to_assembler_name_hash(symtab_node*, bool)
/space/rguenther/src/svn/trunk2/gcc/symtab.c:171
0xa816f9 symbol_table::symtab_initialize_asm_name_hash()
/space/rguenther/src/svn/trunk2/gcc/symtab.c:252
0xa835e4 symtab_node::get_for_asmname(tree_node const*)
/space/rguenther/src/svn/trunk2/gcc/symtab.c:926
0xa9b481 handle_alias_pairs
/space/rguenther/src/svn/trunk2/gcc/cgraphunit.c:1123
0xa9eaac symbol_table::finalize_compilation_unit()
/space/rguenther/src/svn/trunk2/gcc/cgraphunit.c:2316
0x7f6366 cp_write_global_declarations()
/space/rguenther/src/svn/trunk2/gcc/cp/decl2.c:4688
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug ipa/64281] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64281

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug tree-optimization/64280] [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
reduced test case:

class A
{
public:
  A ();
};
class B
{
public:
  B (int);
  operator void *() { return m_fn1 () ? 0 : this; }
  int m_fn1 ();
};
typedef int jmp_buf[];
struct C
{
  jmp_buf cond_;
};
class F
{
  C what_;
  bool m_fn2 ();
};
int _setjmp (int[]);
void longjmp ();
class D
{
public:
  D () { longjmp (); }
};
bool
F::m_fn2 ()
{
  B a (0);
  if (a)
if (_setjmp (what_.cond_))
  return 0;
else
  D ();
  A b;
}


[Bug ipa/64282] [5 Regression] ICE in gimple_get_virt_method_for_vtable, at gimple-fold.c:5635

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64282

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug ipa/64282] New: [5 Regression] ICE in gimple_get_virt_method_for_vtable, at gimple-fold.c:5635

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64282

Bug ID: 64282
   Summary: [5 Regression] ICE in
gimple_get_virt_method_for_vtable, at
gimple-fold.c:5635
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

Created attachment 34263
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34263action=edit
preprocessed source

 ./cc1plus  -quiet scim_skk_dictionary.ii -O2
scim_skk_dictionary.cpp:1190:1: internal compiler error: in
gimple_get_virt_method_for_vtable, at gimple-fold.c:5635
0xc44ef1 gimple_get_virt_method_for_vtable(long, tree_node*, unsigned long,
bool*)
/space/rguenther/src/svn/trunk2/gcc/gimple-fold.c:5635
0x1812801 ipa_get_indirect_edge_target_1
/space/rguenther/src/svn/trunk2/gcc/ipa-cp.c:1932
0x1812dd9 ipa_get_indirect_edge_target(cgraph_edge*, vectree_node*, va_heap,
vl_ptr, vecipa_polymorphic_call_context, va_heap, vl_ptr,
vecipa_agg_jump_function*, va_heap, vl_ptr, bool*)
/space/rguenther/src/svn/trunk2/gcc/ipa-cp.c:2030
0xd42213 estimate_edge_devirt_benefit
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3007
0xd42394 estimate_edge_size_and_time
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3048
0xd4262e estimate_calls_size_and_time
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3110
0xd4256a estimate_calls_size_and_time
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3098
0xd42aaa estimate_node_size_and_time
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3205
0xd44129 do_estimate_edge_time(cgraph_edge*)
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3701
0xd44303 do_estimate_edge_size(cgraph_edge*)
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3752
0xd394e2 estimate_edge_size
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.h:289
0xd39549 estimate_edge_growth
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.h:302
0xd44688 estimate_size_after_inlining(cgraph_node*, cgraph_edge*)
/space/rguenther/src/svn/trunk2/gcc/ipa-inline-analysis.c:3845
0x1824835 caller_growth_limits
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:204
0x1824f3f can_inline_edge_p
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:374
0x1827307 update_caller_keys
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:1208
0x1828ede inline_small_functions
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:1838
0x1829e68 ipa_inline
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:2189
0x182a996 execute
/space/rguenther/src/svn/trunk2/gcc/ipa-inline.c:2562
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug tree-optimization/64283] New: [5 Regression] ICE: in verify_ssa, at tree-ssa.c:939

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64283

Bug ID: 64283
   Summary: [5 Regression] ICE: in verify_ssa, at tree-ssa.c:939
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

Created attachment 34264
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34264action=edit
preprocessed source

 ./cc1 -quiet dev.i -O2
../net/core/dev.c: In function 'dev_change_net_namespace.part.93':
../net/core/dev.c:7285:1: internal compiler error: in verify_ssa, at
tree-ssa.c:939
0xf9eaf7 verify_ssa(bool, bool)
/space/rguenther/src/svn/trunk2/gcc/tree-ssa.c:939
0xc486f4 execute_function_todo
/space/rguenther/src/svn/trunk2/gcc/passes.c:1947
0xc478a1 do_per_function
/space/rguenther/src/svn/trunk2/gcc/passes.c:1639
0xc48892 execute_todo
/space/rguenther/src/svn/trunk2/gcc/passes.c:1997
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug tree-optimization/64283] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:939

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64283

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug ipa/64281] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64281

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
dup.

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


[Bug middle-end/61558] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61558

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #15 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
*** Bug 64281 has been marked as a duplicate of this bug. ***


[Bug ipa/64282] [5 Regression] ICE in gimple_get_virt_method_for_vtable, at gimple-fold.c:5635

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64282

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
Might be a dup of PR64139.


[Bug ipa/63569] [5.0 Regression] Wrong code with volatile and ICF

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63569

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #10 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
*** Bug 64283 has been marked as a duplicate of this bug. ***


[Bug tree-optimization/64283] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:939

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64283

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #1 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
dup.

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


[Bug c/60784] Spurious -Wmissing-field-initializers warning for anonymous structure

2014-12-12 Thread peter at lekensteyn dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60784

--- Comment #7 from Peter Wu peter at lekensteyn dot nl ---
This bug is still present in GCC 4.9.2 and 4.9.3 (prerelease 20141210). Now
building gcc-5-20141207 to verify. (Not sure whether this gets backported to
4.9.x, just checking.)

//
gcc -Wextra bug.c -o /dev/null
//
typedef struct HidppMessage {
struct {
int feature_index;
int func;
};
} HidppMessage;

int main(void) {
HidppMessage req = {
.feature_index  = 0xFF,
.func   = 1
};
return req.func;
}
//

Strange enough, replacing 0xFF by 0x00 hides the warning.


[Bug tree-optimization/64280] [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org ---
Mine.


[Bug c++/58796] throw nullptr not caught by catch(type*)

2014-12-12 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58796

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 CC||jwakely.gcc at gmail dot com

--- Comment #2 from Paolo Carlini paolo.carlini at oracle dot com ---
Looks like this is (also) a runtime issue: normally works on clang, but does
*not* if -stdlib=libstdc++ is added to the command line. Futher evidence: does
not work with icc, which uses the system runtime, but works with eccp.


[Bug ipa/64282] [5 Regression] ICE in gimple_get_virt_method_for_vtable, at gimple-fold.c:5635

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64282

--- Comment #2 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
reduced test case:

template class _T1 struct A
{
  _T1 first;
};
struct B
{
  int operator!=(B);
};
template typename _Tp struct C
{
  C (B);
  _Tp operator*();
  int operator!=(C);
};
template typename _Tp class D
{
public:
  typedef C_Tp const_iterator;
  const_iterator m_fn1 () const;
  B m_fn2 ();
  void m_fn3 ();
};
class F
{
  struct G
  {
static G 
m_fn5 ()
{
  void fn1 ();
  return *reinterpret_castG * (fn1);
}
int *
m_fn6 ()
{
  return reinterpret_castint * (this);
}
  };
  struct _Alloc_hider
  {
_Alloc_hider (int *p1, int) : _M_p (p1) {}
int *_M_p;
  } _M_dataplus;
  G 
  m_fn4 ()
  {
return G::m_fn5 ();
  }
public:
  F () : _M_dataplus (m_fn4 ().m_fn6 (), 0) {}
};
class H
{
  void m_fn7 (const F , bool );
  bool m_fn8 (const DF , const F , F );
};
typedef Aint CandPair;
class I
{
public:
  virtual void m_fn9 (const F , bool, DCandPair );
};
class J : I
{
public:
  void m_fn9 (const F , bool, DCandPair );
};
DI * c;
void
J::m_fn9 (const F , bool, DCandPair )
{
  Dint a;
  for (B b; b != a.m_fn2 ();)
;
}
inline void
fn2 (F p1, int, int, J *p4, DCandPair)
{
  DCandPair d;
  d.m_fn3 ();
  p4-m_fn9 (p1, 0, d);
  for (DI *::const_iterator e = c.m_fn1 (); e != c.m_fn2 ();)
(*e)-m_fn9 (p1, 0, d);
}
void
H::m_fn7 (const F , bool )
{
  AF f;
  DF g;
  F h;
  m_fn8 (g, f.first, h);
}
bool
H::m_fn8 (const DF p1, const F , F )
{
  F i;
  p1.m_fn1 ();
  DCandPair j;
  fn2 (i, 0, 0, 0, j);
}


[Bug tree-optimization/64284] New: [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64284

Bug ID: 64284
   Summary: [5 Regression] ICE: Segmentation fault
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org

Created attachment 34265
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34265action=edit
preprocessed source

 ./cc1 -quiet scp.i -O2
scp.c: In function 'shell_quotearg':
scp.c:126:1: internal compiler error: Segmentation fault
0xd473a0 crash_signal
/space/rguenther/src/svn/trunk2/gcc/toplev.c:358
0xf8bde8 thread_through_loop_header
/space/rguenther/src/svn/trunk2/gcc/tree-ssa-threadupdate.c:1869
0xf8d8e8 thread_through_all_blocks(bool)
/space/rguenther/src/svn/trunk2/gcc/tree-ssa-threadupdate.c:2570
0x1027bd9 finalize_jump_threads
/space/rguenther/src/svn/trunk2/gcc/tree-vrp.c:10151
0x1027fd6 execute_vrp
/space/rguenther/src/svn/trunk2/gcc/tree-vrp.c:10305
0x102825c execute
/space/rguenther/src/svn/trunk2/gcc/tree-vrp.c:10368
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See http://gcc.gnu.org/bugs.html for instructions.


[Bug tree-optimization/64284] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64284

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug ipa/64139] [4.9/5 Regression] ice in possible_polymorphic_call_targets, at ipa-devirt.c:2410

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64139

Markus Trippelsdorf trippels at gcc dot gnu.org changed:

   What|Removed |Added

 CC||trippels at gcc dot gnu.org
Summary|[5 Regression] ice in   |[4.9/5 Regression] ice in
   |possible_polymorphic_call_t |possible_polymorphic_call_t
   |argets, at  |argets, at
   |ipa-devirt.c:2410   |ipa-devirt.c:2410
  Known to fail||4.9.1, 5.0

--- Comment #5 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
reduced test case:

class IObject {
public:
  virtual ~IObject();
};
class A {
  virtual int m_fn1();
};
class B {
public:
  virtual int m_fn2(B) const;
};
class D : IObject, public virtual B {};
class G : public D, A {
public:
  G(A);
};
class F : B {
  friend class C;
};
class C {
  void m_fn3(const IObject , int );
  void m_fn4(const B , int );
};
A a;
void C::m_fn3(const IObject , int p2) {
  G r(a);
  m_fn4(r, p2);
}
void C::m_fn4(const B p1, int ) {
  F b;
  p1.m_fn2(b);
}

Also ICEs with gcc-4.9:

trippels@gcc20 ~ % g++ -c -O2 bug178.cc
bug178.cc: In member function ‘void C::m_fn3(const IObject, int)’:
bug178.cc:32:1: internal compiler error: in possible_polymorphic_call_targets,
at ipa-devirt.c:1557

[Bug lto/64285] New: [5 Regression] During LTO: ICE segfault in ipa_polymorphic_call_context::get_dynamic_type

2014-12-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64285

Bug ID: 64285
   Summary: [5 Regression] During LTO: ICE segfault in
ipa_polymorphic_call_context::get_dynamic_type
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org

I tried compiling the program again which gave the ICE of PR64043, motivated by
the patch https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01076.html which looks
vaguely related.

In any case, it now (r218661) fails with:

gcc-trunk/include/c++/5.0.0/bits/unique_ptr.h:70:0: internal compiler error:
Segmentation fault
   operator()(_Tp* __ptr) const
 ^
0xa2576f crash_signal
../../gcc/toplev.c:358
0x878d2f tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:2778
0x878d2f ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*,
tree_node*, gimple_statement_base*)
../../gcc/ipa-polymorphic-call.c:1594
0xb9f23e eliminate_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-pre.c:4334
0xfde647 dom_walker::walk(basic_block_def*)
../../gcc/domwalk.c:188
0xba0da0 eliminate
../../gcc/tree-ssa-pre.c:4491
0xba0ff5 execute
../../gcc/tree-ssa-pre.c:4910


Testcase reduction under way


[Bug tree-optimization/64284] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64284

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
 CC||spop at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
  Registering jump thread: (4, 5) incoming edge;  (5, 55) joiner;  (55, 63)
normal;
  Registering FSM jump thread: (94, 5) incoming edge;  (6, 20) nocopy;
  Registering jump thread: (61, 6) incoming edge;  (6, 20) normal;
  Registering jump thread: (77, 6) incoming edge;  (6, 20) normal;
  Registering jump thread: (69, 6) incoming edge;  (6, 20) normal;
  Registering FSM jump thread: (94, 5) incoming edge;  (55, 56) nocopy;
...
  Threaded jump 69 -- 6 to 109
  Threaded jump 77 -- 6 to 109
  Threaded jump 61 -- 6 to 109

and then we end up with an invalid loop.  FSM threads the latch edge but
doesn't update the loop structure accordingly so later asking for the
loop latch edge fails (because the loop isn't anymore it seems - or
header and latch are no longer valid).

Let me have a look.


[Bug tree-optimization/64284] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64284

--- Comment #2 from Markus Trippelsdorf trippels at gcc dot gnu.org ---
trippels@gcc20 ~ % cat scp.i
int *a;
int b;
int
fn1() {
  enum { QSTRING } c = 0;
  while (1) {
switch (*a) {
case '\'':
  c = 0;
default:
  switch (c)
  case 0:
  if (b)
return 0;
  c = 1;
}
a++;
  }
}


[Bug libstdc++/64276] would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64276

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2014-12-12
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Jonathan Wakely redi at gcc dot gnu.org ---
There is no reason not to make this change, __cpp_exceptions is the portable,
WG21-recommended way to tell if the compiler supports try/catch.


[Bug tree-optimization/64284] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64284

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
Sth like

Index: tree-ssa-threadupdate.c
===
--- tree-ssa-threadupdate.c (revision 218621)
+++ tree-ssa-threadupdate.c (working copy)
@@ -2364,7 +2364,7 @@ duplicate_seme_region (edge entry, edge
   basic_block *region_copy)
 {
   unsigned i;
-  bool free_region_copy = false, copying_header = false;
+  bool free_region_copy = false;
   struct loop *loop = entry-dest-loop_father;
   edge exit_copy;
   edge redirected;
@@ -2388,10 +2388,7 @@ duplicate_seme_region (edge entry, edge

   initialize_original_copy_tables ();

-  if (copying_header)
-set_loop_copy (loop, loop_outer (loop));
-  else
-set_loop_copy (loop, loop);
+  set_loop_copy (loop, loop);

   if (!region_copy)
 {
@@ -2453,6 +2450,8 @@ duplicate_seme_region (edge entry, edge
   }

   /* Redirect the entry and add the phi node arguments.  */
+  if (entry-dest == loop-header)
+mark_loop_for_removal (loop);
   redirected = redirect_edge_and_branch (entry, get_bb_copy (entry-dest));
   gcc_assert (redirected != NULL);
   flush_pending_stmts (entry);

works but results in the less than optimal

fix_loop_structure: fixing up loops for function
fix_loop_structure: removing loop 1
flow_loops_find: discovered new loop 2 with header 5

in the testcase the loop header will be entry-src it seems - not sure
how reliably that is in the full generality of duplicate_seme_region.
We know that all blocks are contained in the same loop, so it must be
possible to compute where the header goes.

Ideally we'd simply set loop-header and loop-latch to the correct values,
marking loops for fixup (to recompute BB ownership - or do even that
ourselves).
The testcase has two latches later, thus loop-latch would be NULL, but
both VRP and DOM init loops without LOOPS_MAY_HAVE_MULTIPLE_LATCHES so we'd
have to disambiguate the loops.

That said - the above patch works.


[Bug lto/64285] [5 Regression] During LTO: ICE segfault in ipa_polymorphic_call_context::get_dynamic_type

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64285

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |5.0


[Bug c/60784] Spurious -Wmissing-field-initializers warning for anonymous structure

2014-12-12 Thread peter at lekensteyn dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60784

--- Comment #8 from Peter Wu peter at lekensteyn dot nl ---
GCC 5 is OK, the question is whether 4.9 will or will not receive a fix?


[Bug rtl-optimization/64255] [5 Regression] failures with -O2 optimization on i = 0 ? (unsigned long) i : - (unsigned long) i

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64255

--- Comment #13 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Dec 12 12:43:34 2014
New Revision: 218665

URL: https://gcc.gnu.org/viewcvs?rev=218665root=gccview=rev
Log:
PR rtl-optimization/64255
* gcc.c-torture/execute/pr64255.c: New test.

PR rtl-optimization/64260
* gcc.c-torture/execute/pr64260.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr64255.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr64260.c
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug tree-optimization/64260] [5 Regression] wrong code at -O1 on x86_64-linux-gnu

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64260

--- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Dec 12 12:43:34 2014
New Revision: 218665

URL: https://gcc.gnu.org/viewcvs?rev=218665root=gccview=rev
Log:
PR rtl-optimization/64255
* gcc.c-torture/execute/pr64255.c: New test.

PR rtl-optimization/64260
* gcc.c-torture/execute/pr64260.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr64255.c
trunk/gcc/testsuite/gcc.c-torture/execute/pr64260.c
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/64286] New: Redundant extend removal ignores vector element type

2014-12-12 Thread sergos.gnu at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64286

Bug ID: 64286
   Summary: Redundant extend removal ignores vector element type
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sergos.gnu at gmail dot com

Created attachment 34266
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34266action=edit
reproducer, taken from public sources

The problem is reproducible starting 4.9 and on trunk also.


The line 29 contains a load into V16QI vector

29:p2 = _mm_loadu_si128((__m128i *) (s - 3 * p));

later used at

60:work = _mm_or_si128(_mm_subs_epu8(p2, p1), _mm_subs_epu8(p1, p2));

and later sign extended into V16HI vector

151:   p256_2 = _mm256_cvtepu8_epi16(p2);



At the phase 217 split2 we have:

(insn 207 204 209 2 (set (reg:V16QI 21 xmm0 [447])
(mem:V16QI (plus:DI (reg/f:DI 6 bp)
(const_int -114 [0xff8e])) [0  S16 A16]))
GCC_Bug.p.c:2609 1136 {*movv16qi_internal}
 (expr_list:REG_EQUIV (mem:V16QI (plus:DI (reg/f:DI 20 frame)
(const_int -66 [0xffbe])) [0  S16 A16])
(nil)))

...

(insn 236 235 238 2 (set (reg:V16QI 22 xmm1 [462])
(us_minus:V16QI (reg:V16QI 23 xmm2 [450])
(reg:V16QI 21 xmm0 [447]))) GCC_Bug.p.c:2925 2096
{*sse2_ussubv16qi3}
 (nil))

... (and number of other operations with xmm0 as V16QI)

(insn 871 869 873 2 (set (reg:V16HI 21 xmm0 [orig:573 D.17673 ] [573])
(zero_extend:V16HI (reg:V16QI 21 xmm0 [447]))) GCC_Bug.p.c:5280 2521
{avx2_zero_extendv16qiv16hi2}
 (nil))


After that REE reports:

---
Trying to eliminate extension:
(insn 871 869 873 2 (set (reg:V16HI 21 xmm0 [orig:573 D.17673 ] [573])
(zero_extend:V16HI (reg:V16QI 21 xmm0 [447]))) GCC_Bug.p.c:5280 2521
{avx2_zero_extendv16qiv16hi2}
 (nil))
Tentatively merged extension with definition :
(insn 207 204 209 2 (set (reg:V16HI 21 xmm0)
(zero_extend:V16HI (mem:V16QI (plus:DI (reg/f:DI 6 bp)
(const_int -114 [0xff8e])) [0  S16 A16])))
GCC_Bug.p.c:2609 -1
 (nil))
deferring rescan insn with uid = 207.
All merges were successful.
Eliminated the extension.
-


That renders all V16QI insns using xmm0 invalid. 

The test should be compiled with 

gcc -O2 GCC_Bug_min.c -mavx2

And run on an avx2-enabled platform.

Correct output:
Is valid: 1

Incorrect output:
Is valid: 0


[Bug tree-optimization/64280] [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
Fixed.


[Bug tree-optimization/64280] [5 Regression] ICE in replace_uses_by, at tree-cfg.c:1789

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64280

--- Comment #4 from Richard Biener rguenth at gcc dot gnu.org ---
Author: rguenth
Date: Fri Dec 12 13:26:15 2014
New Revision: 218668

URL: https://gcc.gnu.org/viewcvs?rev=218668root=gccview=rev
Log:
2014-12-12  Richard Biener  rguent...@suse.de

PR middle-end/64280
* tree-cfg.c (replace_uses_by): Guard assert properly.

* g++.dg/torture/pr64280.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr64280.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfg.c


[Bug middle-end/61558] [5 Regression] ICE: Segmentation fault

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61558

--- Comment #16 from Richard Biener rguenth at gcc dot gnu.org ---
This triggers a _lot_ when re-building openSUSE with GCC 5. And it is
especially
annoying because Segmentation fault isn't a nice ICE to filter.

Please fix this bug soon.


[Bug c++/64265] r217669 broke tsan

2014-12-12 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #1 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
with current trunk we get this in test.cpp.176t.cplxlower0:

static void std::_Destroy_auxanonymous ::__destroy(_ForwardIterator,
_ForwardIterator) [with _ForwardIterator = std::basic_stringchar*; bool
anonymous = false] (struct basic_string * __first, struct basic_string *
__last)
{
  struct basic_string * D.17011;
  struct basic_string * _7;

  bb 2:
  # __first_1 = PHI __first_3(D)(0), __first_9(3)
  if (__first_1 == __last_5(D))
goto bb 4;
  else
goto bb 3;

  bb 3:
  _7 = std::__addressofstd::basic_stringchar  (__first_1);
  std::_Destroystd::basic_stringchar  (_7);
  __first_9 = __first_1 + 8;
  goto bb 2;

  bb 4:
  return;

which is tranformed to this in test.cpp.178t.tsan0:

static void std::_Destroy_auxanonymous ::__destroy(_ForwardIterator,
_ForwardIterator) [with _ForwardIterator = std::basic_stringchar*; bool
anonymous = false] (struct basic_string * __first, struct basic_string *
__last)
{
  struct basic_string * D.17011;
  struct basic_string * _7;
  void * _10;

  bb 2:
  # __first_1 = PHI __first_3(D)(0), __first_9(3)
  _10 = __builtin_return_address (0);
  __builtin___tsan_func_entry (_10);
  if (__first_1 == __last_5(D))
goto bb 4;
  else
goto bb 3;

  bb 3:
  _7 = std::__addressofstd::basic_stringchar  (__first_1);
  std::_Destroystd::basic_stringchar  (_7);
  __first_9 = __first_1 + 8;
  goto bb 2;

  bb 4:
  __builtin___tsan_func_exit ();
  return;

}


but with r217669 reverted, we get in test.cpp.176t.cplxlower0:

static void std::_Destroy_auxanonymous ::__destroy(_ForwardIterator,
_ForwardIterator) [with _ForwardIterator = std::basic_stringchar*; bool
anonymous = false] (struct basic_string * __first, struct basic_string *
__last)
{
  struct basic_string * D.17027;
  struct basic_string * _7;

  bb 2:
  goto bb 4;

  bb 3:
  _7 = std::__addressofstd::basic_stringchar  (__first_1);
  std::_Destroystd::basic_stringchar  (_7);
  __first_9 = __first_1 + 8;

  bb 4:
  # __first_1 = PHI __first_3(D)(2), __first_9(3)
  if (__first_1 != __last_5(D))
goto bb 3;
  else
goto bb 5;

  bb 5:
  return;

}

which is transformed to this in test.cpp.178t.tsan0:

static void std::_Destroy_auxanonymous ::__destroy(_ForwardIterator,
_ForwardIterator) [with _ForwardIterator = std::basic_stringchar*; bool
anonymous = false] (struct basic_string * __first, struct basic_string *
__last)
{
  struct basic_string * D.17027;
  struct basic_string * _7;
  void * _10;

  bb 2:
  _10 = __builtin_return_address (0);
  __builtin___tsan_func_entry (_10);
  goto bb 4;

  bb 3:
  _7 = std::__addressofstd::basic_stringchar  (__first_1);
  std::_Destroystd::basic_stringchar  (_7);
  __first_9 = __first_1 + 8;

  bb 4:
  # __first_1 = PHI __first_3(D)(2), __first_9(3)
  if (__first_1 != __last_5(D))
goto bb 3;
  else
goto bb 5;

  bb 5:
  __builtin___tsan_func_exit ();
  return;

}


[Bug tree-optimization/64269] [4.8/4.9/5 Regression] ICE with -O3 enabled on Ubuntu 14.04

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64269

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Fri Dec 12 13:32:16 2014
New Revision: 218669

URL: https://gcc.gnu.org/viewcvs?rev=218669root=gccview=rev
Log:
PR tree-optimization/64269
* tree-ssa-forwprop.c (simplify_builtin_call): Bail out if
len2 or diff are too large.

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

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr64269.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-forwprop.c


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-12
 CC||dodji at gcc dot gnu.org,
   ||dvyukov at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||kcc at gcc dot gnu.org
  Component|c++ |sanitizer
   Target Milestone|--- |5.0
Summary|r217669 broke tsan  |[5 Regression] r217669
   ||broke tsan
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org ---
So it looks like tsan wants to instrument the function entry edge but instead
instruments the first basic block without considering backedges.

Latent TSAN bug.


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #3 from Richard Biener rguenth at gcc dot gnu.org ---
static void
instrument_func_entry (void)
{
  basic_block succ_bb;
  gimple_stmt_iterator gsi;
  tree ret_addr, builtin_decl;
  gimple g;

  succ_bb = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun));
  gsi = gsi_after_labels (succ_bb);

indeed.

It should do

  succ_bb = split_edge (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)));
  gsi = gsi_after_labels (succ_bb);

instead for example.  Or use gsi_insert_on_edge_immediate () and insert
on the edge (that avoids splitting the edge if not necessary).


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread bernd.edlinger at hotmail dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #4 from Bernd Edlinger bernd.edlinger at hotmail dot de ---
and now I see that his example is mis-compiled too:

cat test1.cpp
int test1(int x)
{
abc:
  x=x+1;
  __builtin_printf(Test %d\n, x);
  if (x9)
goto abc;
  return 0;
}


is transformed to this in test1.cpp.178t.tsan0:

int test1(int) (int x)
{
  int D.2636;
  int _7;
  void * _8;

  # x_1 = PHI x_3(D)(0), x_5(3)
abc:
  _8 = __builtin_return_address (0);
  __builtin___tsan_func_entry (_8);
  x_5 = x_1 + 1;
  __builtin_printf (Test %d\n, x_5);
  if (x_5 = 8)
goto bb 3;
  else
goto bb 4;

  bb 3:
  goto bb 2 (abc);

  bb 4:
  _7 = 0;

L3:
  __builtin___tsan_func_exit ();
  return _7;

}

with or without r217669, and also if test1.cpp is renamed to test1.c !


[Bug c++/64261] false branch of conditional operator ?: evaluated in a template constexpr

2014-12-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64261

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

 CC||ville.voutilainen at gmail dot 
com

--- Comment #3 from Ville Voutilainen ville.voutilainen at gmail dot com ---
I don't see any warnings with either 4.9.1 or with 5.0.


[Bug middle-end/64274] [5.0 Regression][ARM] gcc.target/arm/fixed-point-exec.c ICE in fold_binary_loc

2014-12-12 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64274

--- Comment #4 from Marek Polacek mpolacek at gcc dot gnu.org ---
Author: mpolacek
Date: Fri Dec 12 14:02:37 2014
New Revision: 218671

URL: https://gcc.gnu.org/viewcvs?rev=218671root=gccview=rev
Log:
PR middle-end/64274
* fold-const.c (fold_binary_loc): Add ANY_INTEGRAL_TYPE_P check.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c


[Bug middle-end/64274] [5.0 Regression][ARM] gcc.target/arm/fixed-point-exec.c ICE in fold_binary_loc

2014-12-12 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64274

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek mpolacek at gcc dot gnu.org ---
Fixed.


[Bug target/64154] enable fipa-ra for Thumb1

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64154

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-12
 CC||ramana at gcc dot gnu.org
 Ever confirmed|0   |1


[Bug bootstrap/63740] [4.9 Regression] GCC 4.9.2 bootstrap fails on ARM, haifa-sched.c:6507:1: internal compiler error: in lra_create

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63740

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cltang at gcc dot gnu.org,
   ||ramana at gcc dot gnu.org

--- Comment #10 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
Useful to CC the original author :)


[Bug c++/63707] Brace initialization of array sometimes fails if no copy constructor

2014-12-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63707

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-12
 CC||ville.voutilainen at gmail dot 
com
 Ever confirmed|0   |1
  Known to fail||4.8.2, 4.9.1, 5.0


[Bug target/63399] Segmentation Fault on pow() function call when all parameters constant, ARM v61 Processor

2014-12-12 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63399

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #3 from ktkachov at gcc dot gnu.org ---
I'm closing this, suspecting a hardware issue. If you do manage to reproduce it
consistently feel free to reopen with more details


[Bug target/61578] Code size increase for ARM thumb compared to 4.8.x when compiling with -Os

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61578

--- Comment #12 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to Fredrik Hederstierna from comment #9)
 Created attachment 33866 [details]
 Simple patch to exclude use of ip
 
 Simple patch that make it possible to optionally exclude use of ip for
 thumb1 when optimizing for size.


Please follow https://gcc.gnu.org/contribute.html with respect to contributing
patches.


[Bug target/61373] neon registers restored incorrectly with -mapcs-frame -O -fno-omit-frame-pointer

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61373

--- Comment #3 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to John Breitenbach from comment #2)
 Created attachment 33301 [details]
 siphash24.i
 
 sorry for forgetting this attachment in the original report.

mapcs-frame comes from a time when Neon didn't exist, it maps to a frame layout
from the old abi and is not necessarily relevant in the EABI world. Using
-mapcs-frame in this form is quite fragile and definitely going to cause more
problems than help in any debugging. You can achieve the same by getting the
ARM style unwind tables and then using the unwinder to unwind to get your
information required.


[Bug libstdc++/64241] make_exception_ptr returns garbage with -fno-exceptions

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64241

--- Comment #1 from Jonathan Wakely redi at gcc dot gnu.org ---
Author: redi
Date: Fri Dec 12 15:10:08 2014
New Revision: 218675

URL: https://gcc.gnu.org/viewcvs?rev=218675root=gccview=rev
Log:
PR libstdc++/64241
* libsupc++/exception_ptr.h: Return empty object when exceptions are
disabled.
* testsuite/18_support/exception_ptr/64241.cc: New.

Added:
trunk/libstdc++-v3/testsuite/18_support/exception_ptr/64241.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/libsupc++/exception_ptr.h


[Bug c++/63604] [C++11] A direct-initialization of a reference should use explicit conversion functions

2014-12-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63604

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

   Keywords||rejects-valid
 CC||ville.voutilainen at gmail dot 
com
  Known to fail||4.8.2, 4.9.1, 5.0

--- Comment #1 from Ville Voutilainen ville.voutilainen at gmail dot com ---
Clang accepts the code.


[Bug c++/57846] CRTP, templates, metaprogramming, forwarding and static member

2014-12-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57846

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-12
 CC||ville.voutilainen at gmail dot 
com
 Ever confirmed|0   |1
  Known to fail||4.8.2, 4.9.1, 5.0

--- Comment #2 from Ville Voutilainen ville.voutilainen at gmail dot com ---
We badly need a reduced testcase for this.


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||ramana at gcc dot gnu.org
 Resolution|--- |WONTFIX

--- Comment #5 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to Fabian Vogt from comment #4)
 (In reply to Andrew Pinski from comment #3)
  (In reply to Fabian Vogt from comment #2)
   It crashes and produces weird results if linked to bFLT.
  
  Yes because EABI is an elf only abi, if it does not have a place for the
  unwind tables, then it is incompatible with the ABI :).
 Is it enough to put it (sorted/ordered) anywhere in the binary and point
 __exidx_start (IIRC) and __exidx_end to the correct positions?
 
  If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still 
  exist?
  
  Because it is supported for some other targets, mainly windows based ones.
 
 Hmm.. Windows RT? :P
 
 Anyway, I had also reported the bug on binutils' bugzilla and the gas
 internal error has been fixed. Nick even made a patch for gcc so it doesn't
 generate bad asm anymore :-)
 
 Bug report on gas: https://sourceware.org/bugzilla/show_bug.cgi?id=16765
 Proposed patch: https://sourceware.org/bugzilla/attachment.cgi?id=7520


On ARM EABI, Linux GNUEABI the standard unwind tables are part of the ABI, sjlj
exceptions are not used and are likely to be completely bit rotten. There is
not much chance that this will work by default on ARM and neither is it going
to be standard configuration. Given this situation and that there is no
interest in this option on ARM I'm going to reject this bug.


[Bug bootstrap/60632] ICE in regcprop.c (copyprop_hardreg_forward_1)

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60632

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2014-12-12
 CC||ramana at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
missing testcase


[Bug c++/61924] [C++11] ICE in instantiate_template_1, at cp/pt.c:15618

2014-12-12 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61924

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.0
Version|unknown |4.9.1
   Keywords||ice-on-invalid-code
   Last reconfirmed||2014-12-12
 CC||ville.voutilainen at gmail dot 
com
 Ever confirmed|0   |1
  Known to fail||4.8.2, 4.9.1

--- Comment #1 from Ville Voutilainen ville.voutilainen at gmail dot com ---
Current trunk accepts the code and diagnoses function::function as not being
defined, like clang does. Previous versions ICE.


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-12-12 Thread fab...@ritter-vogt.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #6 from Fabian Vogt fab...@ritter-vogt.de ---
If sjlj exceptions are not supported for ARM, shouldn't the configure option be
invalid for ARM or at least print a warning?
If an option does exist and it simply crashes the compiler during make, it's
definitely broken and must be removed.


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #7 from Jonathan Wakely redi at gcc dot gnu.org ---
Just don't do silly things.

Just because an option exists doesn't mean you need to use it.


[Bug lto/64285] [5 Regression] During LTO: ICE segfault in ipa_polymorphic_call_context::get_dynamic_type

2014-12-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64285

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Tobias Burnus burnus at gcc dot gnu.org ---
Now the other PR fails with the same message.

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


[Bug lto/64043] [5 Regression] ICE (segfault) with LTO: in tree_check/tree.h:2758 get_binfo_at_offset/tree.c:11914

2014-12-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64043

--- Comment #6 from Tobias Burnus burnus at gcc dot gnu.org ---
*** Bug 64285 has been marked as a duplicate of this bug. ***


[Bug lto/64043] [5 Regression] ICE (segfault) with LTO: in tree_check/tree.h:2758 get_binfo_at_offset/tree.c:11914

2014-12-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64043

--- Comment #7 from Tobias Burnus burnus at gcc dot gnu.org ---
Now fails with the following backtrace. The location of the failure might have
changed due to the patch at
https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01076.html ; in any case,
currently the failure is:


foo.ii: In member function ‘__base_dtor ’:
foo.ii:11:1: internal compiler error: Segmentation fault
 FooWriter::~FooWriter () { delete validator; }
 ^
0xa1f99f crash_signal
../../gcc/toplev.c:358
0x873daf tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:2778
0x873daf ipa_polymorphic_call_context::get_dynamic_type(tree_node*, tree_node*,
tree_node*, gimple_statement_base*)
0xb9787e eliminate_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-ssa-pre.c:4334

[Bug middle-end/64182] [5 Regression] wide-int rounding division is broken

2014-12-12 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64182

--- Comment #9 from rsandifo at gcc dot gnu.org rsandifo at gcc dot gnu.org 
---
Author: rsandifo
Date: Fri Dec 12 15:46:57 2014
New Revision: 218678

URL: https://gcc.gnu.org/viewcvs?rev=218678root=gccview=rev
Log:
gcc/
PR middle-end/64182
* wide-int.h (wi::div_round, wi::mod_round): Fix rounding of tied
cases.
* double-int.c (div_and_round_double): Fix handling of unsigned
cases.  Use same rounding approach as wide-int.h.

gcc/testsuite/
2014-xx-xx  Richard Sandiford  richard.sandif...@arm.com
Joseph Myers  jos...@codesourcery.com

PR middle-end/64182
* gcc.dg/plugin/wide-int-test-1.c,
gcc.dg/plugin/wide-int_plugin.c: New test.
* gcc.dg/plugin/plugin.exp: Register it.
* gnat.dg/round_div.adb: New test.

Added:
trunk/gcc/testsuite/gcc.dg/plugin/wide-int-test-1.c
trunk/gcc/testsuite/gcc.dg/plugin/wide-int_plugin.c
trunk/gcc/testsuite/gnat.dg/round_div.adb
Modified:
trunk/gcc/ChangeLog
trunk/gcc/double-int.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/plugin/plugin.exp
trunk/gcc/wide-int.h


[Bug rtl-optimization/64287] New: Disable -fuse-caller-save when -pg is active

2014-12-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64287

Bug ID: 64287
   Summary: Disable -fuse-caller-save when -pg is active
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vries at gcc dot gnu.org

As discussed in https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01496.html :
...
A problem is detected with building Linux kernel on MIPS platform when
both -fuse-caller-save and -pg options are present. The reason for this
is that -fuse-caller-save relies on the analysis of RTL code, but when
profiling is active (with -pg option) the code is instrumented
by adding a call to mcount function at the beginning of each function.
And this is realized on the most platforms simply by fprintf function,
so this instrumentation is not reflected in RTL code. The result is
that bad code is produced. A solution could be to disable -fuse-caller-save
when -pg is active.
...


[Bug rtl-optimization/64287] [5 Regression] Disable -fuse-caller-save when -pg is active

2014-12-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64287

vries at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P1
Summary|Disable -fuse-caller-save   |[5 Regression] Disable
   |when -pg is active  |-fuse-caller-save when -pg
   ||is active


[Bug libstdc++/64288] New: libstdc++ testsuite not compatible with -fno-rtti or -fno-exceptions

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64288

Bug ID: 64288
   Summary: libstdc++ testsuite not compatible with -fno-rtti or
-fno-exceptions
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org

In order to check that libstdc++ degrades nicely when used with -fno-rtti or
-fno-exceptions it would be good if the testsuite ran cleanly with those
options.

Currently there is no way to disable tests that rely on RTTI or exceptions so
maybe we want dg-require-rtti and dg-require-exceptions procs.


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

Bernd Edlinger edlinger at gcc dot gnu.org changed:

   What|Removed |Added

 CC||edlinger at gcc dot gnu.org

--- Comment #5 from Bernd Edlinger edlinger at gcc dot gnu.org ---
Aehm, and if the function throws, the __tsan_func_exit is not
called either:

cat test2.cpp
struct my_class
{
  my_class(){}
};

int test1(int x) throw(my_class)
{
  throw my_class();
  return x;
}


int
main()
{
  for (int i=0; i1000; i++)
  {
try
{
  test1(i);
}
catch (my_class)
{
}
  }
  return 0;
}


g++ -g -fsanitize=thread test2.cpp

./a.out

= here we have another memory leak.


[Bug libstdc++/64276] would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64276

--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org ---
Author: redi
Date: Fri Dec 12 15:58:49 2014
New Revision: 218679

URL: https://gcc.gnu.org/viewcvs?rev=218679root=gccview=rev
Log:
PR libstdc++/64276
* doc/doxygen/user.cfg.in: Define __cpp_exceptions and __cpp_rtti.
* doc/html/manual/using_exceptions.html: Regenerate.
* doc/xml/manual/using_exceptions.xml: Use SD-6 feature-testing
macros, __cpp_exceptions and __cpp_rtti, instead of __EXCEPTIONS and
__GXX_RTTI.
* include/bits/c++config: Likewise.
* include/bits/locale_classes.tcc: Likewise.
* include/bits/shared_ptr.h: Likewise.
* include/bits/shared_ptr_base.h: Likewise.
* include/debug/formatter.h: Likewise.
* include/experimental/any: Likewise.
* include/ext/rope: Likewise.
* include/ext/ropeimpl.h: Likewise.
* include/std/functional: Likewise.
* include/tr1/functional: Likewise.
* include/tr1/shared_ptr.h: Likewise.
* libsupc++/eh_call.cc: Likewise.
* libsupc++/eh_personality.cc: Likewise.
* libsupc++/exception_defines.h: Likewise.
* libsupc++/exception_ptr.h: Likewise.
* libsupc++/guard.cc: Likewise.
* libsupc++/pbase_type_info.cc: Likewise.
* libsupc++/pointer_type_info.cc: Likewise.
* libsupc++/vterminate.cc: Likewise.
* src/c++11/thread.cc: Likewise.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/doc/doxygen/user.cfg.in
trunk/libstdc++-v3/doc/html/manual/using_exceptions.html
trunk/libstdc++-v3/doc/xml/manual/using_exceptions.xml
trunk/libstdc++-v3/include/bits/c++config
trunk/libstdc++-v3/include/bits/locale_classes.tcc
trunk/libstdc++-v3/include/bits/shared_ptr.h
trunk/libstdc++-v3/include/bits/shared_ptr_base.h
trunk/libstdc++-v3/include/debug/formatter.h
trunk/libstdc++-v3/include/experimental/any
trunk/libstdc++-v3/include/ext/rope
trunk/libstdc++-v3/include/ext/ropeimpl.h
trunk/libstdc++-v3/include/std/functional
trunk/libstdc++-v3/include/tr1/functional
trunk/libstdc++-v3/include/tr1/shared_ptr.h
trunk/libstdc++-v3/libsupc++/eh_call.cc
trunk/libstdc++-v3/libsupc++/eh_personality.cc
trunk/libstdc++-v3/libsupc++/exception_defines.h
trunk/libstdc++-v3/libsupc++/exception_ptr.h
trunk/libstdc++-v3/libsupc++/guard.cc
trunk/libstdc++-v3/libsupc++/pbase_type_info.cc
trunk/libstdc++-v3/libsupc++/pointer_type_info.cc
trunk/libstdc++-v3/libsupc++/vterminate.cc
trunk/libstdc++-v3/src/c++11/thread.cc


[Bug libstdc++/64276] would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64276

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.0

--- Comment #5 from Jonathan Wakely redi at gcc dot gnu.org ---
Done.


[Bug rtl-optimization/64287] [5 Regression] Disable -fuse-caller-save when -pg is active

2014-12-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64287

--- Comment #1 from vries at gcc dot gnu.org ---
AFAIK, Radovan (radovan.obrado...@imgtec.com) is working on this.


[Bug libstdc++/64241] make_exception_ptr returns garbage with -fno-exceptions

2014-12-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64241

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.0

--- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org ---
Not planning to backport this because using exception_ptr with -fno-exceptions
is probably not important to anyone.


[Bug sanitizer/64289] New: ICE with -fsanitize=float-cast-overflow

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64289

Bug ID: 64289
   Summary: ICE with -fsanitize=float-cast-overflow
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: jakub at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org,
mpolacek at gcc dot gnu.org

/* { dg-do compile } */
/* { dg-options -fsanitize=float-cast-overflow } */

int
foo (int a)
{
  return (int) (0 ? 0 : a ? a : 0.5);
}

ICEs when compiled as C, because save_expr must not be used until c_fully_fold.
Unfortunately as convert.c is shared by all FEs, it can't call c_save_expr
instead.  So, either we'd need to turn it into a langhook, or we need a
workaround in c-convert.c like we've done already for the other save_expr in
convert.c case.


[Bug rtl-optimization/64287] [5 Regression] Disable -fuse-caller-save when -pg is active

2014-12-12 Thread vries at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64287

vries at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||patch
 CC||law at gcc dot gnu.org

--- Comment #2 from vries at gcc dot gnu.org ---
STATUS

patch: https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01829.html

approval with question on testing:
https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02162.html


[Bug sanitizer/64289] ICE with -fsanitize=float-cast-overflow

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64289

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-12
   Target Milestone|--- |5.0
 Ever confirmed|0   |1


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-12-12 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #8 from Ramana Radhakrishnan ramana at gcc dot gnu.org ---
(In reply to Fabian Vogt from comment #6)
 If sjlj exceptions are not supported for ARM, shouldn't the configure option
 be invalid for ARM or at least print a warning?
 If an option does exist and it simply crashes the compiler during make, it's
 definitely broken and must be removed.

If that were a user option then yes, I agree.

If folks are building their own toolchains, they should know what they are
doing and not just use options because they think it may just work willy-nilly.


[Bug sanitizer/59302] tsan: Unexpected mmap in InternalAllocator!

2014-12-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59302

Dmitry Vyukov dvyukov at google dot com changed:

   What|Removed |Added

 CC||dvyukov at google dot com

--- Comment #4 from Dmitry Vyukov dvyukov at google dot com ---
The referenced issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59194
is marked as fixed. I propose to fix this issue, but I don't see an option to
change status.


[Bug sanitizer/59410] tsan tests fail with address randomization disabled

2014-12-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59410

Dmitry Vyukov dvyukov at google dot com changed:

   What|Removed |Added

 CC||dvyukov at google dot com

--- Comment #34 from Dmitry Vyukov dvyukov at google dot com ---
I propose to close this as obsolete. Or does somebody see any actionable items
here?
Non-pie binaries are supported by tsan now. Non-aslr (0x5) are not.


[Bug sanitizer/64289] ICE with -fsanitize=float-cast-overflow

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64289

--- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org ---
Created attachment 34267
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34267action=edit
gcc5-pr64289.patch

Untested fix.


[Bug fortran/64290] New: Destructor not called at deallocation of LHS

2014-12-12 Thread baradi09 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64290

Bug ID: 64290
   Summary: Destructor not called at deallocation of LHS
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: baradi09 at gmail dot com

Created attachment 34268
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34268action=edit
Self contained source demonstrating

During an assingment with an allocatable type on both, the LHS and the RHS, the
destructor of the LHS-type is not called. IMHO, this is erroneous behaviour as
the LHS gets (hopfully) deallocated on the assignment.


[Bug c++/61402] [5 Regression][C++1y] Init-capture with side effect not working for some types

2014-12-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61402

--- Comment #4 from Jason Merrill jason at gcc dot gnu.org ---
Author: jason
Date: Fri Dec 12 16:43:16 2014
New Revision: 218680

URL: https://gcc.gnu.org/viewcvs?rev=218680root=gccview=rev
Log:
PR c++/61402
* lambda.c (add_capture): Don't pass a dependent type to
variably_modified_type_p.

Added:
trunk/gcc/testsuite/g++.dg/cpp1y/lambda-init11.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/lambda.c


[Bug sanitizer/59410] tsan tests fail with address randomization disabled

2014-12-12 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59410

H.J. Lu hjl.tools at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #35 from H.J. Lu hjl.tools at gmail dot com ---
Binutils 2.25 will mark PIE with
non-zero load address as executable
so that any kernel will load it at
specified address.


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
Seems there are more such spots that insert stmts at gsi_after_labels of
single_succ of entry block - e.g. ipa-split.c, omp-low.c, tree-inline.c,
tree-into-ssa.c, tree-profile.c, tree-ssa-reassoc.c at least.

I'll take care of tsan.c.


[Bug c++/63996] Infinite loop in invalid C++14 constexpr fn

2014-12-12 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63996

--- Comment #1 from Kai Tietz ktietz at gcc dot gnu.org ---
Author: ktietz
Date: Fri Dec 12 17:14:54 2014
New Revision: 218682

URL: https://gcc.gnu.org/viewcvs?rev=218682root=gccview=rev
Log:
PR c++/63996
* constexpr.c (cxx_eval_loop_expr): Don't loop
endless on none-constant expression.


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


[Bug c++/63996] Infinite loop in invalid C++14 constexpr fn

2014-12-12 Thread ktietz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63996

--- Comment #2 from Kai Tietz ktietz at gcc dot gnu.org ---
Author: ktietz
Date: Fri Dec 12 17:17:58 2014
New Revision: 218683

URL: https://gcc.gnu.org/viewcvs?rev=218683root=gccview=rev
Log:
PR c++/63996
* g++.dg/cpp1y/pr63996.C: New file.


Added:
trunk/gcc/testsuite/g++.dg/cpp1y/pr63996.C
Modified:
trunk/gcc/testsuite/ChangeLog


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org ---
Note, I don't see any kind of memory leak on any of the testcases.
Sure, calling __tsan_func_entry many times is of course wrong.
As for #c5, clang doesn't call __tsan_func_exit in that case either.  Dmitry?
If we were to call it even for exceptions, I'm afraid expanding this in tsan
pass is too late, we'd need to add the __tsan_func_exit call say during
gimplification as a cleanup of the whole body and then EH code would take care
of adding the needed landing pads etc.
But libtsan e.g. wraps longjmp and pops frames in there, not sure if it doesn't
do something similar for exceptions already.


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread dvyukov at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

Dmitry Vyukov dvyukov at google dot com changed:

   What|Removed |Added

 CC||dvyukov at google dot com

--- Comment #8 from Dmitry Vyukov dvyukov at google dot com ---
Exceptions are currently unsupported by tsan.
Yes, we can do either what we do in longjmp if it's possible to figure out the
landing frame in runtime, or add __tsan_func_exit to cleanup statements for
each function in compiler (obviously simpler for runtime, but more complex for
compiler).
I don't know what is simpler and what is exceptions ABI. Is it possible to do
what we do for longjmp for exceptions?
There is an issue for this in tsan tracker:
https://code.google.com/p/thread-sanitizer/issues/detail?id=78


[Bug middle-end/64246] [5 Regression] ICE building libada for Windows due to NULL loop header

2014-12-12 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64246

--- Comment #3 from Eric Botcazou ebotcazou at gcc dot gnu.org ---
Created attachment 34269
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34269action=edit
Concatenated testcase

To be gnatchop-ed and compile at -O.


[Bug go/61307] gccgo: ICE in Create_function_descriptors::expression [GoSmith]

2014-12-12 Thread cmang at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61307

Chris Manghane cmang at google dot com changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Chris Manghane cmang at google dot com ---
Unable to resolve.


[Bug sanitizer/64265] [5 Regression] r217669 broke tsan

2014-12-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64265

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org ---
Doing it in gimplify_function_tree is pretty straightforward, after all, we
already have there code to handle
  if (flag_instrument_function_entry_exit
   !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)
   !flag_instrument_functions_exclude_p (fndecl))
which does very similar thing - on entry add a call to one function with
address of current function and __builtin_return_address (0), on exit
(including exit through exceptions) another call with the same arguments.

So, the question is just if you want to do it that way...


[Bug rtl-optimization/64291] New: [5 Regression] Miscompile t-div in GMP's testsuite

2014-12-12 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64291

Bug ID: 64291
   Summary: [5 Regression] Miscompile t-div in GMP's testsuite
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: glisse at gcc dot gnu.org

In the following code, on x86_64-unknown-linux-gnu, we should call g(0,8,16),
but we somehow end up calling g(0,16,16). The most suspicious dump is
marc.c.228r.postreload.

$ gcc-4.9 -O2 marc.c f.c  ./a.out

$ gcc-5 -O2 marc.c f.c  ./a.out
a.out: f.c:3: g: Assertion `a==8' failed.
zsh: abort  ./a.out

$ cat f.c
#include assert.h
void f(void*p,...){}
void g(void*p,long a,long b){assert(a==8);}

$ cat marc.c
void f(void*,...);
void g(void*,long,long);
int nnn=0;
long test=0;

typedef struct
{
  int _mp_size;
  unsigned long *_mp_d;
} __mpz_struct;
typedef __mpz_struct mpz_t[1];

int main ()
{
  mpz_t n, d;
  long nn, dn;
  unsigned long *np, *dup, *dnp, *qp;
  long alloc, itch;

  f (n);
  f (d);
  qp = (unsigned long*)__builtin_alloca(4099*8) + 1;
  dnp = (unsigned long*)__builtin_alloca (2049*8);
  alloc = 1;
  for (test = 0; test  1; test++)
  {
dn = d-_mp_size;
dup = d-_mp_d;
f (dnp, dup, dn);
dnp[dn - 1] |= 1UL63;
f (0);
nn = nnn;
np = n-_mp_d;
qp[-1] = -757136820;
qp[nn - dn + 1] = 14883681;
f (0);
if (dn = 6)
  f (0);
itch = nn + 1;
if (itch + 1 alloc)
{
  g(0,alloc*8,(itch+1)*8);
  alloc = itch + 1;
}
f (np, nn);
  }
  return 0;
}


  1   2   >