[Bug other/58712] [4.9 Regression] issues found by --enable-checking=valgrind

2013-10-14 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58712

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org,
   ||rguenth at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf  ---
Adding CC.
1,3) Honza
2) Richard


[Bug other/58712] New: [4.9 Regression] issues found by --enable-checking=valgrind

2013-10-13 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58712

Bug ID: 58712
   Summary: [4.9 Regression] issues found by
--enable-checking=valgrind
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

1)
==4348== Conditional jump or move depends on uninitialised value(s)
==4348==at 0x5CF50C: cgraph_create_edge_1(cgraph_node*, cgraph_node*,
gimple_statement_d*, long, int) (cgraph.c:695)
==4348==by 0x5D005E: cgraph_create_edge(cgraph_node*, cgraph_node*,
gimple_statement_d*, long, int) (cgraph.c:890)
==4348==by 0x5D80A1: cgraph_clone_edge(cgraph_edge*, cgraph_node*,
gimple_statement_d*, unsigned int, long, int, bool) (cgraphclones.c:135)
==4348==by 0x86C7E4: copy_body(copy_body_data*, long, int,
basic_block_def*, basic_block_def*, basic_block_def*) (tree-inline.c:1741)
==4348==by 0x86F94F: optimize_inline_calls(tree_node*) (tree-inline.c:4258)
==4348==by 0xC0029A: (anonymous namespace)::pass_early_inline::execute()
(ipa-inline.c:2257)
==4348==by 0x793AA9: execute_one_pass(opt_pass*) (passes.c:2202)
==4348==by 0x793C55: execute_pass_list(opt_pass*) (passes.c:2254)
==4348==by 0x7926C2: do_per_function_toporder(void (*)(void*), void*)
(passes.c:1620)
==4348==by 0x7941A6: execute_ipa_pass_list(opt_pass*) (passes.c:2572)
==4348==by 0x5D7721: compile() (cgraphunit.c:1981)
==4348==by 0x5D7E24: finalize_compilation_unit() (cgraphunit.c:2269)
==4348== 

Probably caused by r201632.

2)
==9588== Use of uninitialised value of size 8
==9588==at 0x8704C5: pointer_set_lookup(pointer_set_t const*, void const*,
unsigned long*) (pointer-set.c:90)
==9588==by 0x870544: pointer_set_insert(pointer_set_t*, void const*)
(pointer-set.c:147)
==9588==by 0x6AB402: analyze_functions() (cgraphunit.c:847)
==9588==by 0x6AC415: finalize_compilation_unit() (cgraphunit.c:2260)
==9588==by 0x568435: cp_write_global_declarations() (decl2.c:4421)
==9588==by 0x90095C: compile_file() (toplev.c:560)
==9588==by 0x902499: toplev_main(int, char**) (toplev.c:1893)
==9588==by 0x4ED5A6D: (below main) (in /lib64/libc-2.18.90.so)
==9588== 
==9588== Conditional jump or move depends on uninitialised value(s)
==9588==at 0x8704CC: pointer_set_lookup(pointer_set_t const*, void const*,
unsigned long*) (pointer-set.c:90)
==9588==by 0x870544: pointer_set_insert(pointer_set_t*, void const*)
(pointer-set.c:147)
==9588==by 0x6AB402: analyze_functions() (cgraphunit.c:847)
==9588==by 0x6AC415: finalize_compilation_unit() (cgraphunit.c:2260)
==9588==by 0x568435: cp_write_global_declarations() (decl2.c:4421)
==9588==by 0x90095C: compile_file() (toplev.c:560)
==9588==by 0x902499: toplev_main(int, char**) (toplev.c:1893)
==9588==by 0x4ED5A6D: (below main) (in /lib64/libc-2.18.90.so)

Probably caused by r200367.

3)
==1269== Invalid write of size 8
==1269==at 0x63BDBD: iterative_hash_canonical_type(tree_node*, unsigned
int) (gimple.c:3220)
==1269==by 0xC224F1: htab_find_slot (hashtab.c:704)
==1269==by 0x641818: gimple_register_canonical_type(tree_node*)
(gimple.c:3488)
==1269==by 0x504AEB: lto_read_decls(lto_file_decl_data*, void const*,
vec) (lto.c:2495)
==1269==by 0x505CBB: lto_main() (lto.c:2786)
==1269==by 0x7B3A95: compile_file() (toplev.c:546)
==1269==by 0x7B5619: toplev_main(int, char**) (toplev.c:1893)
==1269==by 0x4ED5A6D: (below main) (in /lib64/libc-2.18.90.so)
==1269==  Address 0x40325a0 is not stack'd, malloc'd or (recently) free'd

This is an older issue, see PR55358 for more info.


[Bug ipa/58678] [4.9 Regression] pykde4-4.11.2 link error (devirtualization too trigger happy)

2013-10-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #3 from Markus Trippelsdorf  ---
Adding __attribute__ ((visibility ("default"))) to
Phonon::BackendCapabilities::Notifier fixes the issue.


[Bug ipa/58678] [4.9 Regression] pykde4-4.11.2 link error (devirtualization too trigger happy)

2013-10-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678

--- Comment #2 from Markus Trippelsdorf  ---
(In reply to Jan Hubicka from comment #1)
> Hmm, what prevents us from devirtualizing here? It seems to be bug to
> include a class without linking with its implementation..

In this case the implementation is linked in, but the symbol
is only local.

 # nm /usr/lib64/libphonon.so.4.6.0 | c++filt | grep "vtable for
Phonon::BackendCapabilities::Notifier"
00066380 d vtable for Phonon::BackendCapabilities::Notifier


[Bug ipa/58678] New: [4.9 Regression] pykde4-4.11.2 link error (devirtualization too trigger happy)

2013-10-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58678

Bug ID: 58678
   Summary: [4.9 Regression] pykde4-4.11.2 link error
(devirtualization too trigger happy)
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

pykde4-4.11.2 fails to build:

CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart5.cpp.o:sipphononpart5.cpp:function
release_Phonon_BackendCapabilities_Notifier: error: undefined reference to
'vtable for Phonon::BackendCapabilities::Notifier'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
the vtable symbol may be undefined because the class is missing its key
function
CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart5.cpp.o:sipphononpart5.cpp:function
Phonon::BackendCapabilities::Notifier::~Notifier(): error: undefined reference
to 'vtable for Phonon::BackendCapabilities::Notifier'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
the vtable symbol may be undefined because the class is missing its key
function
CMakeFiles/python_module_PyKDE4_phonon.dir/sip/phonon/sipphononpart5.cpp.o:sipphononpart5.cpp:function
Phonon::BackendCapabilities::Notifier::~Notifier(): error: undefined reference
to 'vtable for Phonon::BackendCapabilities::Notifier'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
the vtable symbol may be undefined because the class is missing its key
function
collect2: error: ld returned 1 exit status

Reduced:

markus@x4 tmp % cat test.ii
class A {
public:
  virtual ~A();
};
class B : A {
  virtual int m_fn1();
};
void fn1() {
  delete reinterpret_cast(1);
}

markus@x4 tmp % g++ -O1 -c test.ii
markus@x4 tmp % nm test.o | c++filt
 T fn1()

markus@x4 tmp % g++ -O2 -c test.ii
markus@x4 tmp % nm test.o | c++filt
 T fn1()
 U operator delete(void*)
 U A::~A()
 W B::~B()
 W B::~B()
 W B::~B()
 n B::~B()
 U vtable for B

markus@x4 tmp % clang++ -O2 -c test.ii
markus@x4 tmp % nm test.o | c++filt
 T fn1()
markus@x4 tmp % 

Started with r202145.


[Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-10-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
  Component|tree-optimization   |c++

--- Comment #2 from Markus Trippelsdorf  ---
Started with r198099.

The following patch apparently "fixes" the issue:

diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index c587e55ac681..9547da539c57 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -7436,7 +7436,6 @@ resolve_address_of_overloaded_function (tree target_type,
  if (same_type_p (target_fn_type, static_fn_type (instantiation)))
matches = tree_cons (instantiation, fn, matches);

- ggc_free (targs);
}

   /* Now, remove all but the most specialized of the matches.  */


[Bug tree-optimization/58627] [4.9 Regression] crash during compilation of boost testsuite

2013-10-05 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

--- Comment #1 from Markus Trippelsdorf  ---
Created attachment 30957
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30957&action=edit
testcase


[Bug tree-optimization/58627] New: [4.9 Regression] crash during compilation of boost testsuite

2013-10-05 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58627

Bug ID: 58627
   Summary: [4.9 Regression] crash during compilation of boost
testsuite
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

Crash happened during compilation of the boost testsuite.
It's hard to reduce the testcase, because it appears to be a bug in the 
garbage-collector.

[With --enable-checking=release]
 % g++ -O0 -std=c++11 -c test.ii 
test.ii: In member function ‘boost::chrono::duration&
boost::chrono::duration::operator--() [with Rep = double; Period =
boost::ratio<1l>]’:
test.ii:3207:286: internal compiler error: Segmentation fault

[gcc-4.8.1 is fine]
 % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/g++ -O2 -std=c++11 -c test.i
 % 

[Backtrace with --enable-checking]
 % gdb --args /var/tmp/gcc_test/usr/local/bin/g++ -w -O0 -std=c++11
-Wfatal-errors -c test.ii -pipe -o /dev/null
Reading symbols from /var/tmp/gcc_test/usr/local/bin/g++...done.
(gdb) run
Starting program: /var/tmp/gcc_test/usr/local/bin/g++ -w -O0 -std=c++11
-Wfatal-errors -c test.ii -pipe -o /dev/null
[New process 20470]
process 20470 is executing new program:
/var/tmp/gcc_test/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1plus

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 20470]
0x00c8e9f8 in tree_class_check_failed (node=,
cl=, file=0xff512d "../../gcc/gcc/c-family/c-common.h",
line=1063, 
function=0xff514f "c_tree_chain_next") at ../../gcc/gcc/tree.c:9223
9223../../gcc/gcc/tree.c: No such file or directory.
(gdb) bt
#0  0x00c8e9f8 in tree_class_check_failed (node=,
cl=, file=0xff512d "../../gcc/gcc/c-family/c-common.h",
line=1063, 
function=0xff514f "c_tree_chain_next") at ../../gcc/gcc/tree.c:9223
#1  0x006807f1 in tree_class_check (__class=,
__f=, __l=, __g=, __t=, 
__class=, __f=, __l=,
__g=) at ../../gcc/gcc/tree.h:2732
#2  c_tree_chain_next (t=) at
../../gcc/gcc/c-family/c-common.h:1063
#3  gt_ggc_mx_lang_tree_node (x_p=) at ./gt-cp-tree.h:158
#4  0x0067f79a in gt_ggc_mx_lang_tree_node (x_p=) at
./gt-cp-tree.h:706
#5  0x00680ba3 in gt_ggc_mx_tinst_level (x_p=) at
./gt-cp-tree.h:124
#6  0x0057b363 in gt_ggc_mx_pending_template (x_p=) at
./gt-cp-pt.h:44
#7  0x008dfa6b in ggc_mark_root_tab (rt=) at
../../gcc/gcc/ggc-common.c:133
#8  ggc_mark_roots () at ../../gcc/gcc/ggc-common.c:152
#9  0x0072d91b in ggc_collect () at ../../gcc/gcc/ggc-page.c:2077
#10 0x0079f9c3 in cgraph_finalize_function (decl=,
no_collect=) at ../../gcc/gcc/cgraphunit.c:456
#11 0x0065c3fc in expand_or_defer_fn (fn=0x7fffeeb57500) at
../../gcc/gcc/cp/semantics.c:3949
#12 0x00574935 in instantiate_decl (d=0x7fffeeb57500, defer_ok=,
expl_inst_class_mem_p=)
at ../../gcc/gcc/cp/pt.c:19406
#13 0x00577738 in instantiate_pending_templates (retries=) at ../../gcc/gcc/cp/pt.c:19493
#14 0x005b9454 in cp_write_global_declarations () at
../../gcc/gcc/cp/decl2.c:4065
#15 0x00aa2196 in compile_file () at ../../gcc/gcc/toplev.c:560
#16 0x00aa1f67 in do_compile () at ../../gcc/gcc/toplev.c:1893
#17 toplev_main (argc=16, argv=0x7fffe028) at ../../gcc/gcc/toplev.c:1969
#18 0x774d3a6e in __libc_start_main () from /lib/libc.so.6
#19 0x004e090d in _start ()

[Bug c++/58555] Floating point exception in want_inline_self_recursive_call_p

2013-09-28 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58555

--- Comment #3 from Markus Trippelsdorf  ---
(In reply to Paolo Carlini from comment #2)
> I think this is for Honza

Yes. Started with r202185 .


[Bug c++/58555] Floating point exception in want_inline_self_recursive_call_p

2013-09-27 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58555

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #1 from Markus Trippelsdorf  ---
Created attachment 30920
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30920&action=edit
reduced testcase


[Bug tree-optimization/58530] [4.9 Regression] crash in get_combined_adhoc_loc

2013-09-25 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58530

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #3 from Markus Trippelsdorf  ---
Reduced:

class B {
public:
  B(...);
};
class C {
  virtual C *m_fn1() const;
};
class D {
public:
  virtual ~D();
};
class G : D, public C {};
class F : G {
  F *m_fn1() const;
};
C *b;
F *F::m_fn1() const {
  if (dynamic_cast(b))
B();
}


[Bug c++/58477] ice in cgraph_speculative_call_info

2013-09-19 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58477

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #1 from Markus Trippelsdorf  ---
markus@x4 tmp % cat test.ii
struct A {
  void operator==(const A &);
};
class B {
public:
  A m_fn1();
  A m_fn2();
};
template  class C {
public:
  T Key;
  const M &m_fn2(const T &);
  virtual void m_fn1() {}
  B _map;
};

C b;
template  const M &C::m_fn2(const T &) {
  A a = _map.m_fn2();
  a == _map.m_fn1();
  m_fn1();
}

void fn1() { b.m_fn2(0); }

markus@x4 tmp % g++ -O2 test.ii
test.ii: In function ‘void fn1()’:
test.ii:24:24: internal compiler error: Segmentation fault

[Bug rtl-optimization/58438] [4.9 Regression] ICE: in check_rtl, at lra.c:2036

2013-09-18 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58438

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #6 from Markus Trippelsdorf  ---
Fixed. Thanks.


[Bug rtl-optimization/58438] New: [4.9 Regression ICE: in check_rtl, at lra.c:2036

2013-09-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58438

Bug ID: 58438
   Summary: [4.9 Regression ICE: in check_rtl, at lra.c:2036
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de


[Bug rtl-optimization/58438] [4.9 Regression] ICE: in check_rtl, at lra.c:2036

2013-09-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58438

--- Comment #1 from Markus Trippelsdorf  ---
During profiled bootstrap:
/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libs
tdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_6
4-pc-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/
libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -march=native -O3 -pipe -fuse-linker-plugin -flto=jobserver -fno-fa
t-lto-objects -frandom-seed=1 -fprofile-generate -fno-lto -DIN_GCC  
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qua
l -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc
-I../../gcc/gcc/. -I../../gcc/gcc
/../include -I../../gcc/gcc/../libcpp/include  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/gcc/../libbacktrace../../
gcc/gcc/tree-ssa-uninit.c -o tree-ssa-uninit.o
../../gcc/gcc/tree-ssa-uninit.c: In function ‘bool
is_use_properly_guarded(gimple, basic_block, gimple, unsigned int,
pointer_set_t*)’:
../../gcc/gcc/tree-ssa-uninit.c:1845:1: internal compiler error: in check_rtl,
at lra.c:2036

Reducing...

[Bug rtl-optimization/58438] [4.9 Regression] ICE: in check_rtl, at lra.c:2036

2013-09-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58438

--- Comment #2 from Markus Trippelsdorf  ---
markus@x4 gcc % cat test.ii
enum gimple_code {};
struct A {
  gimple_code code;
};
struct B {
  A gsbase;
};
int **a;
int b, d, e, f, g, h, i, j, k, l, m, n, o;
gimple_code c, p;
class C {
  virtual unsigned m_fn1();
};
B q;
static int fn1() {
  int r;
  if (k)
i = 0;
  for (; i; j++) {
b = c <= 0;
if (b)
  n = *a[0];
b = p && c;
if (b)
  r = *a[0];
b = q.gsbase.code && c;
if (b)
  o = *a[0];
m = o;
if (e || 1 & r || d || l)
  return 0;
  }
}

class D : C {
  unsigned m_fn1() {
fn1();
for (; h; g++)
  for (;; f++)
;
  }
};
void fn2() { new D; }

markus@x4 gcc % g++ -c -march=amdfam10 -O3 -fprofile-generate test.ii
test.ii: In member function ‘virtual unsigned int D::m_fn1()’:
test.ii:41:3: internal compiler error: in check_rtl, at lra.c:2036

[Bug tree-optimization/58432] [4.9 Regression] ICE: in insert_value_copy_on_edge, at tree-outof-ssa.c:233

2013-09-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58432

--- Comment #1 from Markus Trippelsdorf  ---
markus@x4 gcc % cat test.ii
struct {
  int prefix;
  int dir_idx;
} *a;
int b;
void fn1() {
  int *c, *d;
  for (; b; b++)
if (d[b]) {
  c[b] = d[b];
  a[0].dir_idx = 0;
}
}

markus@x4 gcc % /var/tmp/gcc_build_dir/./prev-gcc/xg++
-B/var/tmp/gcc_build_dir/./prev-gcc/ -c -O3 -fprofile-generate test.ii
test.ii:4:4: warning: anonymous type with no linkage used to declare variable
‘* a’ with linkage [enabled by default]
 } *a;
^
test.ii: In function ‘void fn1()’:
test.ii:6:6: internal compiler error: in insert_value_copy_on_edge, at
tree-outof-ssa.c:233
 void fn1() {
  ^

[Bug tree-optimization/58432] New: [4.9 Regression] ICE: in insert_value_copy_on_edge, at tree-outof-ssa.c:233

2013-09-16 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58432

Bug ID: 58432
   Summary: [4.9 Regression]  ICE: in insert_value_copy_on_edge,
at tree-outof-ssa.c:233
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

During profiled bootstrap:
/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-p
c-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-
v3/include/x86_64-pc-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++ -L/var/tmp/gcc_build_dir/prev-x86_
64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -march=native -O3 -pipe -fuse-linker-plugin -flto=j
observer -fno-fat-lto-objects -frandom-seed=1 -fprofile-generate -fno-lto
-DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-st
rings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I.
-I../../gcc/gcc -I../../gcc/gcc/.
 -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbac
ktrace../../gcc/gcc/dwarf2out.c -o dwarf2out.o
../../gcc/gcc/dwarf2out.c: In function ‘void output_file_names()’:
../../gcc/gcc/dwarf2out.c:9577:1: internal compiler error: in
insert_value_copy_on_edge, at tree-outof-ssa.c:233

Reducing...

[Bug ipa/58367] [4.9 Regression] lto/pgo bootstrap failure

2013-09-13 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #5 from Markus Trippelsdorf  ---
dup

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


[Bug middle-end/58387] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu (both 32-bit and 64-bit modes)

2013-09-13 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58387

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #13 from Markus Trippelsdorf  ---
*** Bug 58367 has been marked as a duplicate of this bug. ***


[Bug ipa/58367] [4.9 Regression] lto/pgo bootstrap failure

2013-09-12 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #4 from Markus Trippelsdorf  ---
Unfortunately I've hit the same issue again today.

In file included from ../../gcc/gcc/expr.c:11198:0:
./gt-expr.h: In function ‘store_expr(tree_node*, rtx_def*, int, bool)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘arcs’) [-Werror=coverage-mismatch]
 };
  ^
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘indirect_call’) [-Werror=coverage-mismath]
...

[Bug tree-optimization/58396] [4.9 Regression] heap-use-after-free at gcc/tree-loop-distribution.c:1959

2013-09-12 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58396

--- Comment #2 from Markus Trippelsdorf  ---
Hopefully a better trace. gcc build with -Og. Testcase needs -O3 to trigger. 

==3882== ERROR: AddressSanitizer: heap-use-after-free on address 0x600600321644
at pc 0x17d7480 bp 0x7fff6d493880 sp 0x7fff6d493878
READ of size 4 at 0x600600321644 thread T0
#0 0x17d747f in vec::length() const
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/vec.h:566
#1 0x17db2f1 in create_rdg_edges
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:385
#2 0x17e3020 in build_rdg
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:564
#3 0x17e7af0 in distribute_loop
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:1813
#4 0x17e9849 in tree_loop_distribution
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:1914
#5 0x17e9b82 in execute
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:1977
#6 0x144e83d in execute_one_pass(opt_pass*)
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/passes.c:2201


[Bug tree-optimization/58396] New: [4.9 Regression] heap-use-after-free at gcc/tree-loop-distribution.c:1959

2013-09-11 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58396

Bug ID: 58396
   Summary: [4.9 Regression] heap-use-after-free at
gcc/tree-loop-distribution.c:1959
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

bootstrap-asan with -O3 gives:

/var/tmp/gcc_build_dir/./gcc/xgcc -shared-libgcc -B/var/tmp/gcc_build_dir/./gcc
-nostdinc++ -L/var/tmp/gcc_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/src
-L/var/tmp/gcc_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include
-I/var/tmp/gcc/libstdc++-v3/../libgcc
-I/var/tmp/gcc_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/var/tmp/gcc_build_dir/x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++ -D_GLIBCXX_SHARED -fno-implicit-templates
-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=bitmap_allocator.lo -march=native -O3 -g -pipe -c
../../../../../gcc/libstdc++-v3/src/c++98/bitmap_allocator.cc -fPIC -DPIC
-D_GLIBCXX_SHARED -o bitmap_allocator.o 2>&1 | asan_symbolize.py | c++filt
=
==20268== ERROR: AddressSanitizer: heap-use-after-free on address
0x6006001646e4 at pc 0x15abf35 bp 0x7fffc85df980 sp 0x7fffc85df978
READ of size 4 at 0x6006001646e4 thread T0
#0 0x15abf34 in build_rdg
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/vec.h:1238
#1 0x15ad344 in distribute_loop
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/tree-loop-distribution.c:1959
#2 0x11f91cf in execute_one_pass(opt_pass*)
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/passes.c:2201
#3 0x11fa99b in execute_pass_list
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/passes.c:2253
#4 0xb3336b in expand_function
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/cgraphunit.c:1723
#5 0xb370a1 in expand_all_functions
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/cgraphunit.c:1828
#6 0xb37f44 in compile
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/cgraphunit.c:2065
#7 0x6d7569 in cp_write_global_declarations()
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/cp/decl2.c:4364
#8 0x14726da in compile_file
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/toplev.c:560
#9 0x1476537 in do_compile
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/toplev.c:1891
#10 0x7f76ffe3aa74 in __libc_start_main
/home/markus/glibc/csu/libc-start.c:269
#11 0x5439e0 in _start /home/markus/glibc/csu/../sysdeps/x86_64/start.S:122
0x6006001646e4 is located 4 bytes inside of 32-byte region
[0x6006001646e0,0x600600164700)
freed by thread T0 here:
#0 0x557e4a in __interceptor_free _asan_rtl_
#1 0x15aa68b in release
/var/tmp/gcc_build_dir/gcc/../../gcc/gcc/vec.h:319
previously allocated by thread T0 here:
#0 0x557f4a in __interceptor_malloc _asan_rtl_
#1 0x24cfa74 in xrealloc
/var/tmp/gcc_build_dir/libiberty/../../gcc/libiberty/xmalloc.c:177
Shadow bytes around the buggy address:
  0x0c0140024880: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
  0x0c0140024890: fd fa fa fa fd fd fd fa fa fa 00 00 00 00 fa fa
  0x0c01400248a0: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa
  0x0c01400248b0: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00
  0x0c01400248c0: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa
=>0x0c01400248d0: 00 00 00 fa fa fa 00 00 00 fa fa fa[fd]fd fd fd
  0x0c01400248e0: fa fa fd fd fd fa fa fa fd fd fd fa fa fa fd fd
  0x0c01400248f0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa
  0x0c0140024900: fd fd fd fa fa fa fd fd fd fa fa fa fd fd fd fa
  0x0c0140024910: fa fa fd fd fd fa fa fa fd fd fd fd fa fa fd fd
  0x0c0140024920: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone: fa
  Heap righ redzone: fb
  Freed Heap region: fd
  Stack left redzone:f1
  Stack mid redzone: f2
  Stack right redzone:   f3
  Stack partial redzone: f4
  Stack after return:f5
  Stack use after scope: f8
  Global redzone:f9
  Global init order: f6
  Poisoned by user:  f7
  ASan internal: fe
==20268== ABORTING

I guess r202431 is to blame.


[Bug tree-optimization/58389] [4.9 Regression] g++ ICE in ipa_find_reference

2013-09-11 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58389

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #2 from Markus Trippelsdorf  ---
Reduced:

template 
void __insertion_sort(_RandomAccessIterator, _Compare);
template 
void __final_insertion_sort(_RandomAccessIterator p1, _Compare p2) {
  _RandomAccessIterator a;
  if (p1 - a)
;
  else
  std:
  __insertion_sort(0, p2);
}
template 
void __introsort_loop(_RandomAccessIterator, _Size, _Compare);
template 
void sort(_RandomAccessIterator, _RandomAccessIterator p2, _Compare p3) {
std:
  __introsort_loop(0, 0, p3);
  __final_insertion_sort(p2, p3);
}
class A {
public:
  int m_fn1();
  void __lg();
  class B {
  public:
int i;
int operator-(B);
  };
};
class C;
class D {
public:
  C *operator->();
};
class F {
  A m_fn1() const;
  D d_ptr;
};
class C {
  friend F;
  void m_fn1();
  A children;
};
void qt_notclosestLeaf();
inline void C::m_fn1() {
  A::B b, c;
  if (children.m_fn1()) {
sort(c, b, qt_notclosestLeaf);
  }
}
A F::m_fn1() const { const_cast(this)->d_ptr->m_fn1(); }


[Bug ipa/58367] [4.9 Regression] lto/pgo bootstrap failure

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

--- Comment #3 from Markus Trippelsdorf  ---
(In reply to Markus Trippelsdorf from comment #2)
> Todays trunk is fine again. I guess r58343 might be the fix.

I meant r202441 is the fix and therefore this bug may be a dup of PR58343.


[Bug ipa/58367] [4.9 Regression] lto/pgo bootstrap failure

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #2 from Markus Trippelsdorf  ---
Todays trunk is fine again. I guess r58343 might be the fix.


[Bug tree-optimization/58380] [4.9 Regression] ice in fold_comparison

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58380

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #5 from Markus Trippelsdorf  ---
Created attachment 30789
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30789&action=edit
reduced testcase

This is what creduce came up with.


[Bug tree-optimization/58373] [4.9 Regression] g++: internal compiler error: Segmentation fault (program cc1plus)

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58373

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #4 from Markus Trippelsdorf  ---
dup of PR58373, fixed by rev202441 .

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


[Bug tree-optimization/58343] [4.9 Regression] ICE in dfs_enumerate_from, at cfganal.c:1036

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58343

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #6 from Markus Trippelsdorf  ---
*** Bug 58373 has been marked as a duplicate of this bug. ***


[Bug tree-optimization/58373] [4.9 Regression] g++: internal compiler error: Segmentation fault (program cc1plus)

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58373

--- Comment #3 from Markus Trippelsdorf  ---
(In reply to Richard Biener from comment #2)
> Looks like cc1plus being miscompiled - does it reproduce with stage1 cc1plus?

Yes. It reproduces with --disable-bootstrap builds using 4.7.3 or 4.8.1.


[Bug tree-optimization/58373] [4.9 Regression] g++: internal compiler error: Segmentation fault (program cc1plus)

2013-09-10 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58373

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf  ---
Started with rev202296.


[Bug tree-optimization/58373] New: [4.9 Regression] g++: internal compiler error: Segmentation fault (program cc1plus)

2013-09-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58373

Bug ID: 58373
   Summary: [4.9 Regression] g++: internal compiler error:
Segmentation fault (program cc1plus)
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

Created attachment 30776
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30776&action=edit
reduced testcase

% gdb --args /var/tmp/gcc_test/usr/local/bin/g++ -c -Wall -Wextra -O3 test.ii
Reading symbols from /var/tmp/gcc_test/usr/local/bin/g++...done.
(gdb) run
Starting program: /var/tmp/gcc_test/usr/local/bin/g++ -c -Wall -Wextra -O3
test.ii
[New process 15370]
process 15370 is executing new program:
/var/tmp/gcc_test/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1plus

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 15370]
0x7765c8fb in __GI___libc_malloc (bytes=200) at malloc.c:2855
2855  victim = _int_malloc(ar_ptr, bytes);
(gdb) bt
#0  0x7765c8fb in __GI___libc_malloc (bytes=200) at malloc.c:2855
#1  0x00ff30c0 in xrealloc (oldmem=, size=200) at
../../gcc/libiberty/xmalloc.c:177
#2  0x00bf62ad in reserve (exact=false,
reserve=, v=) at ../../gcc/gcc/vec.h:300
#3  vec_safe_reserve (exact=false,
nelems=, v=) at ../../gcc/gcc/vec.h:668
#4  vec_alloc (nelems=,
v=) at ../../gcc/gcc/vec.h:689
#5  copy (this=0x1634de0) at ../../gcc/gcc/vec.h:917
#6  copy (this=) at ../../gcc/gcc/vec.h:1460
#7  phi_translate_1 (expr=expr@entry=0x16aef80, set1=set1@entry=0x16b35d0,
set2=set2@entry=0x0, pred=pred@entry=0x770855b0,
phiblock=phiblock@entry=0x7706fbc8) at ../../gcc/gcc/tree-ssa-pre.c:1589
#8  0x00bf6adc in phi_translate (expr=0x16aef80, set1=0x16b35d0,
set2=0x0, pred=0x770855b0, phiblock=0x7706fbc8) at
../../gcc/gcc/tree-ssa-pre.c:1774
#9  0x00bf61c4 in phi_translate_1 (expr=expr@entry=0x169b550,
set1=set1@entry=0x16b35d0, set2=set2@entry=0x0, pred=pred@entry=0x770855b0,
phiblock=phiblock@entry=0x7706fbc8) at ../../gcc/gcc/tree-ssa-pre.c:1463
#10 0x00bf6adc in phi_translate (expr=0x169b550, set1=0x16b35d0,
set2=0x0, pred=0x770855b0, phiblock=0x7706fbc8) at
../../gcc/gcc/tree-ssa-pre.c:1774
...


[Bug sanitizer/56535] ICE: in build2_stat, at tree.c:3885 when compiling with -fsanitize=address

2013-09-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56535

--- Comment #7 from Markus Trippelsdorf  ---
Current trunk still fails with the same error:

/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/local/x86_64-unknown-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -march=native -O3 -pipe -fsanitize=address -fprofile-use -DIN_GCC  
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H
-DGENERATOR_FILE -I. -Ibuild -I../../gcc/gcc -I../../gcc/gcc/build
-I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include 
-I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid
-I../libdecnumber -I../../gcc/gcc/../libbacktrace\
-o build/genmodes.o ../../gcc/gcc/genmodes.c
../../gcc/gcc/genmodes.c: In function ‘void
make_complex_modes.constprop(mode_class, unsigned int)’:
../../gcc/gcc/genmodes.c:423:1: internal compiler error: in build2_stat, at
tree.c:4104
 make_complex_modes (enum mode_class cl,
 ^

[Bug ipa/58367] [4.9 Regression] lto/pgo bootstrap failure

2013-09-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

--- Comment #1 from Markus Trippelsdorf  ---
Created attachment 30769
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30769&action=edit
unreduced testcase

markus@x4 gcc % /var/tmp/gcc_build_dir/./prev-gcc/cc1plus -quiet -O2
-fprofile-use -fno-exceptions -fno-rtti expr.ii
In file included from ../../gcc/gcc/expr.c:11183:0:
./gt-expr.h: In function ‘rtx_def* store_expr(tree, rtx, int, bool)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘arcs’) [-Werror=coverage-mismatch]
 };
  ^
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘indirect_call’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘rtx_def* clear_storage_hints(rtx, rtx,
block_op_methods, unsigned int, long int)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z19clear_storage_hintsP7rtx_defS0_16block_op_methodsjl’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘void store_by_pieces_1(store_by_pieces_d*, unsigned
int)’:
./gt-expr.h:33:2: error: the control flow of function
‘_ZL17store_by_pieces_1P17store_by_pieces_dj’ does not match its profile data
(counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘rtx_def* store_by_pieces(rtx, long unsigned int,
rtx_def* (*)(void*, long int, machine_mode), void*, unsigned int, bool, int)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z15store_by_piecesP7rtx_defmPFS0_Pvl12machine_modeES1_jbi’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘int can_store_by_pieces(long unsigned int, rtx_def*
(*)(void*, long int, machine_mode), void*, unsigned int, bool)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z19can_store_by_piecesmPFP7rtx_defPvl12machine_modeES1_jb’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h:33:2: error: the control flow of function
‘_Z19can_store_by_piecesmPFP7rtx_defPvl12machine_modeES1_jb’ does not match its
profile data (counter ‘indirect_call’) [-Werror=coverage-mismatch]
cc1plus: some warnings being treated as errors

(gcc from two days ago is fine:)
markus@x4 gcc % /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus -quiet -O2
-fprofile-use -fno-exceptions -fno-rtti expr.ii
markus@x4 gcc %

[Bug ipa/58367] New: [4.9 Regression] lto/pgo bootstrap failure

2013-09-09 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58367

Bug ID: 58367
   Summary: [4.9 Regression] lto/pgo bootstrap failure
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

On current trunk (rev202381) I get:
...
/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/var/tmp/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -march=native -O2 -pipe -fuse-linker-plugin -flto=jobserver
-fno-fat-lto-objects -frandom-seed=1 -fprofile-use -DIN_GCC   -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I.
-I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
-I../../gcc/gcc/../libcpp/include  -I../../gcc/gcc/../libdecnumber
-I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/gcc/../libbacktrace../../gcc/gcc/expr.c -o expr.o
In file included from ../../gcc/gcc/expr.c:11183:0:
./gt-expr.h: In function ‘store_expr(tree_node*, rtx_def*, int, bool)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘arcs’) [-Werror=coverage-mismatch]
 };
  ^
./gt-expr.h:33:2: error: the control flow of function
‘_Z10store_exprP9tree_nodeP7rtx_defib’ does not match its profile data (counter
‘indirect_call’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘clear_storage_hints(rtx_def*, rtx_def*,
block_op_methods, unsigned int, long)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z19clear_storage_hintsP7rtx_defS0_16block_op_methodsjl’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘store_by_pieces_1(store_by_pieces_d*, unsigned int)’:
./gt-expr.h:33:2: error: the control flow of function
‘_ZL17store_by_pieces_1P17store_by_pieces_dj’ does not match its profile data
(counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘store_by_pieces(rtx_def*, unsigned long, rtx_def*
(*)(void*, long, machine_mode), void*, unsigned int, bool, int)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z15store_by_piecesP7rtx_defmPFS0_Pvl12machine_modeES1_jbi’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h: In function ‘can_store_by_pieces(unsigned long, rtx_def*
(*)(void*, long, machine_mode), void*, unsigned int, bool)’:
./gt-expr.h:33:2: error: the control flow of function
‘_Z19can_store_by_piecesmPFP7rtx_defPvl12machine_modeES1_jb’ does not match its
profile data (counter ‘arcs’) [-Werror=coverage-mismatch]
./gt-expr.h:33:2: error: the control flow of function
‘_Z19can_store_by_piecesmPFP7rtx_defPvl12machine_modeES1_jb’ does not match its
profile data (counter ‘indirect_call’) [-Werror=coverage-mismatch]

with »make -j4 BOOT_CFLAGS="-march=native -O2 -pipe"
STAGE1_CFLAGS="-march=native -O2 -pipe" CFLAGS_FOR_TARGET="-march=native -O2
-pipe" CXXFLAGS_FOR_TARGET="-march=native -O2 -pipe" profiledbootstrap«

[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2013-09-06 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375

--- Comment #196 from Markus Trippelsdorf  ---
(In reply to Jan Hubicka from comment #195)
> Today there was two fixes for bugs that produce undefined symbols like one
> you see.
> Does the problem still exist on current mainline?  Are you using profile
> feedback?

The problem is gone on current mainline. (And yes I'm using profile feedback.)


[Bug ipa/58313] [4.9 Regression] kdelibs build failure

2013-09-04 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58313

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Markus Trippelsdorf  ---
dup

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


[Bug c++/58201] [4.9 Regression] Undefined reference to `B::B(void const**)'

2013-09-04 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58201

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #6 from Markus Trippelsdorf  ---
*** Bug 58313 has been marked as a duplicate of this bug. ***


[Bug ipa/58313] [4.9 Regression] kdelibs build failure

2013-09-04 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58313

--- Comment #3 from Markus Trippelsdorf  ---
Probably dup of Bug 58201.


[Bug ipa/58313] [4.9 Regression] kdelibs build failure

2013-09-04 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58313

--- Comment #1 from Markus Trippelsdorf  ---
markus@x4 tmp % g++ c -O2 test.ii
markus@x4 tmp % nm test.o|grep _ZN8KNetwork18KPassiveSocketBase
 U _ZN8KNetwork18KPassiveSocketBaseC2EPPKv
markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/g++ -Wall -c -O2 test.ii
markus@x4 tmp % nm test.o|grep _ZN8KNetwork18KPassiveSocketBase
 U _ZN8KNetwork18KPassiveSocketBaseC2Ev
markus@x4 tmp % c++filt _ZN8KNetwork18KPassiveSocketBaseC2EPPKv
KNetwork::KPassiveSocketBase::KPassiveSocketBase(void const**)
markus@x4 tmp % c++filt _ZN8KNetwork18KPassiveSocketBaseC2Ev
KNetwork::KPassiveSocketBase::KPassiveSocketBase()


[Bug ipa/58313] New: [4.9 Regression] kdelibs build failure

2013-09-04 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58313

Bug ID: 58313
   Summary: [4.9 Regression] kdelibs build failure
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

Building kdelibs-4.11.1 fails when linking kdecore:
...
CMakeFiles/kdecore.dir/network/k3socketdevice.o:k3socketdevice.cpp:function
_ZN8KNetwork13KSocketDeviceC2EPKNS_11KSocketBaseEP7QObject: error: undefined
reference to '_ZN8KNe
twork17KActiveSocketBaseC2EPPKvP7QObject'
CMakeFiles/kdecore.dir/network/k3socketdevice.o:k3socketdevice.cpp:function
_ZN8KNetwork13KSocketDeviceC2EPKNS_11KSocketBaseEP7QObject: error: undefined
reference to '_ZN8KNe
twork18KPassiveSocketBaseC2EPPKv'
CMakeFiles/kdecore.dir/network/k3socketdevice.o:k3socketdevice.cpp:function
_ZN8KNetwork13KSocketDeviceC1EPKNS_11KSocketBaseEP7QObject: error: undefined
reference to '_ZN8KNe
twork17KActiveSocketBaseC2EPPKvP7QObject'
CMakeFiles/kdecore.dir/network/k3socketdevice.o:k3socketdevice.cpp:function
_ZN8KNetwork13KSocketDeviceC1EPKNS_11KSocketBaseEP7QObject: error: undefined
reference to '_ZN8KNe
twork18KPassiveSocketBaseC2EPPKv'
...

I've reduced this issue to:

markus@x4 tmp % cat test.ii
namespace KNetwork {
class A {};
class KPassiveSocketBase : virtual A {
public:
  KPassiveSocketBase();
};
class B : KPassiveSocketBase {
  B();
};
}
using namespace KNetwork;
B::B() {}

markus@x4 tmp % g++ -c -O2 test.ii
markus@x4 tmp % nm test.o | grep _ZN8KNetwork18KPassiveSocketBaseC2EPPKv
 U _ZN8KNetwork18KPassiveSocketBaseC2EPPKv
markus@x4 tmp %  /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/g++ -c -O2 test.ii
markus@x4 tmp % nm test.o | grep _ZN8KNetwork18KPassiveSocketBaseC2EPPKv
markus@x4 tmp %


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2013-09-03 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375

--- Comment #194 from Markus Trippelsdorf  ---
(In reply to Jan Hubicka from comment #193)
> I am building firefox with -O3 and get no undefined symbols.  Can you,
> please, relink with -Wl,--no-demangle --save-temps -fdump-ipa-all and try to
> look up the missing symbol in -lm.res file and if it not UNDEF there make
> somewhere available the dumps?
> If it is undefined there, it may be firefox bug..

Hmm, it's strange, because there are five undefined references;
one of them does not appear in lm.res at all and the other four 
are all PREVAILING_DEF_IRONLY.
(The whole dump is huge. Please tell me which part you need and
I will try to upload it somewhere.)


[Bug tree-optimization/58294] [4.9 Regression] ice in update_ssa_across_abnormal_edges, at tree-inline.c:1892

2013-09-02 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58294

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #3 from Markus Trippelsdorf  ---
Reduced:

struct A {
  virtual ~A();
  virtual void m_fn1() { delete this; }
  void m_fn2() { m_fn1(); }
};

struct B {
  A *pi_;
  B() { pi_->m_fn2(); }
};
struct C {
  B pn;
};
void _setjmp();
int png_decode() {
  _setjmp();
  C a;
  return 0;
}


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2013-08-29 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375

--- Comment #192 from Markus Trippelsdorf  ---
It turned out that -enable-optimize=-O3 is the cause.
Rev202079 with -Os links fine.


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2013-08-29 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375

--- Comment #191 from Markus Trippelsdorf  ---
First of all many thanks for your work on reducing memory usage.
Peak memory usage is now lower (~3GB) than clang's (~4GB).

However, with -enable-optimize=-O3 on rev202079 I get:
(An default (-Os) build on rev202053 went fine this morning)

/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccd3grW1.ltrans0.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against '_ZN17nsHtt
pTransaction18ReadRequestSegmentEP14nsIInputStreamPvPKcjjPj' which may overflow
at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccd3grW1.ltrans0.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against '_ZN17nsHtt
pTransaction18ReadRequestSegmentEP14nsIInputStreamPvPKcjjPj' which may overflow
at runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccd3grW1.ltrans1.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against '_ZN16nsInp
utStreamTee15WriteSegmentFunEP14nsIInputStreamPvPKcjjPj' which may overflow at
runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /tmp/ccd3grW1.ltrans24.ltrans.o: requires dynamic R_X86_64_PC32 reloc
against '_ZN16nsIn
putStreamTee15WriteSegmentFunEP14nsIInputStreamPvPKcjjPj' which may overflow at
runtime; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: read-only segment has dynamic relocations
/tmp/ccd3grW1.ltrans0.ltrans.o:ccd3grW1.ltrans0.o:function
nsHttpTransaction::ReadSegments(nsAHttpSegmentReader*, unsigned int, unsigned
int*): error: undefined reference to 
'nsHttpTransaction::ReadRequestSegment(nsIInputStream*, void*, char const*,
unsigned int, unsigned int, unsigned int*)'
/tmp/ccd3grW1.ltrans0.ltrans.o:ccd3grW1.ltrans0.o:function
nsHttpConnection::OnSocketWritable(): error: undefined reference to
'nsHttpTransaction::ReadRequestSegment(nsIInput
Stream*, void*, char const*, unsigned int, unsigned int, unsigned int*)'
/tmp/ccd3grW1.ltrans0.ltrans.o:ccd3grW1.ltrans0.o:function
nsHttpPipeline::ReadSegments(nsAHttpSegmentReader*, unsigned int, unsigned
int*): error: undefined reference to 'ns
HttpPipeline::ReadFromPipe(nsIInputStream*, void*, char const*, unsigned int,
unsigned int, unsigned int*)'
/tmp/ccd3grW1.ltrans1.ltrans.o:ccd3grW1.ltrans1.o:function
imgRequest::OnDataAvailable(nsIRequest*, nsISupports*, nsIInputStream*,
unsigned long, unsigned int): error: undefi
ned reference to 'nsInputStreamTee::WriteSegmentFun(nsIInputStream*, void*,
char const*, unsigned int, unsigned int, unsigned int*)'
/tmp/ccd3grW1.ltrans24.ltrans.o:ccd3grW1.ltrans24.o:function
nsInputStreamTee::ReadSegments(tag_nsresult (*)(nsIInputStream*, void*, char
const*, unsigned int, unsigned int, 
unsigned int*), void*, unsigned int, unsigned int*): error: undefined reference
to 'nsInputStreamTee::WriteSegmentFun(nsIInputStream*, void*, char const*,
unsigned int, unsig
ned int, unsigned int*)'

Not sure if -O3 or rev202079 is to blame.


[Bug gcov-profile/58250] New: -fprofile-use causes: "warning: -fprefetch-loop-arrays is not supported with -Os"

2013-08-27 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58250

Bug ID: 58250
   Summary: -fprofile-use causes: "warning: -fprefetch-loop-arrays
is not supported with -Os"
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

Just noticed this issue during a PGO/LTO Firefox build.
During the -fprofile-use phase I always get the following warning:
 warning: -fprefetch-loop-arrays is not supported with -Os [enabled by default]

This is caused by rev.193135:
   /* Enable sw prefetching at -O3 for CPUS that prefetching is helpful.  */
   if (flag_prefetch_loop_arrays < 0
   && HAVE_prefetch
-  && optimize >= 3
+  && (optimize >= 3 || flag_profile_use)
   && TARGET_SOFTWARE_PREFETCHING_BENEFICIAL)
 flag_prefetch_loop_arrays = 1;


Does the following patch look OK?

diff --git a/gcc/toplev.c b/gcc/toplev.c
index 53f53fd..9955ed4 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1506,7 +1506,7 @@ process_options (void)

   /* This combination of options isn't handled for i386 targets and doesn't
  make much sense anyway, so don't allow it.  */
-  if (flag_prefetch_loop_arrays > 0 && optimize_size)
+  if (flag_prefetch_loop_arrays > 0 && optimize_size && !flag_profile_use)
 {
   warning (0, "-fprefetch-loop-arrays is not supported with -Os");
   flag_prefetch_loop_arrays = 0;


[Bug other/57324] Undefined behavior issues found with clang's -fsanitize=undefined

2013-07-26 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57324

--- Comment #2 from Markus Trippelsdorf  ---
Created attachment 30557
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30557&action=edit
output

unwrapped output


[Bug other/57324] Undefined behavior issues found with clang's -fsanitize=undefined

2013-07-26 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57324

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||glisse at gcc dot gnu.org

--- Comment #1 from Markus Trippelsdorf  ---
Here's a list of issues found on current trunk. 
I've applied Marc's patch already:
http://gcc.gnu.org/ml/gcc-patches/2013-06/msg01466.html

(steps to reproduce:
 % CC="clang -fsanitize=undefined -fno-sanitize=bounds -w" CXX="clang++
-fsanitize=undefined -fno-sanitize=bounds -w" ../gcc/configure
--disable-bootstrap --disable-werror --disable-multilib
--enable-languages=c,c++,fortran
 % make &> out #has to be single threaded
 % grep "runtime error" out | sort -u
)

../../gcc/gcc/config/i386/i386.c:21307:37: runtime error: left shift of
negative value -1073807360
../../gcc/gcc/config/i386/i386.c:21307:37: runtime error: left shift of
negative value -65537
../../gcc/gcc/config/i386/i386.c:21307:44: runtime error: left shift of
negative value -140739635838976
../../gcc/gcc/config/i386/i386.c:21307:44: runtime error: left shift of
negative value -2305983746702049280
../../gcc/gcc/cselib.c:1121:43: runtime error: signed integer overflow: 4096 +
9223372036854775806 cannot be represented in type 'long'
../../gcc/gcc/cselib.c:1121:43: runtime error: signed integer overflow: 4096 +
9223372036854775807 cannot be represented in type 'long'
../../gcc/gcc/dce.c:278:16: runtime error: left shift of negative value -1
../../gcc/gcc/double-int.c:141:13: runtime error: negation of
-9223372036854775808 cannot be represented in type 'long'; cast to an unsigned
type to negate this value to itself
../../gcc/gcc/dwarf2out.c:11344:61: runtime error: left shift of negative value
-1
../../gcc/gcc/dwarf2out.c:11359:54: runtime error: left shift of negative value
-1
../../gcc/gcc/expmed.c:2941:15: runtime error: left shift of negative value -1
../../gcc/gcc/expr.c:3861:17: runtime error: signed integer overflow: 0 -
-9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/genattrtab.c:622:27: runtime error: signed integer overflow:
4568797 * 613 cannot be represented in type 'int'
../../gcc/gcc/genautomata.c:3499:23: runtime error: shift exponent 64 is too
large for 64-bit type 'set_el_t' (aka 'unsigned long')
../../gcc/gcc/haifa-sched.c:1142:24: runtime error: left shift of negative
value -1
../../gcc/gcc/haifa-sched.c:1405:26: runtime error: left shift of negative
value -1
../../gcc/gcc/ipa-inline-analysis.c:341:18: runtime error: shift exponent 32 is
too large for 32-bit type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-130939929 * 270 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-130942930 * 1000 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-131071000 * 590 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-131074014 * 1000 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-16383781 * 250 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-262141984 * 250 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-262141984 * 62 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-33685247 * 90 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-58981950 * 90 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-59636850 * 65 cannot be represented in type 'int'
../../gcc/gcc/ira-color.c:1362:29: runtime error: signed integer overflow:
-69626841 * 999 cannot be represented in type 'int'
../../gcc/gcc/loop-iv.c:2276:24: runtime error: signed integer overflow:
9223372036854775807 - -9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/loop-iv.c:2614:14: runtime error: signed integer overflow:
9223372036854775806 - -9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/postreload.c:1769:44: runtime error: signed integer overflow: 0 -
-9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/postreload.c:1769:44: runtime error: signed integer overflow: 11
- -9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/postreload.c:1769:44: runtime error: signed integer overflow: 20
- -9223372036854775808 cannot be represented in type 'long'
../../gcc/gcc/postreload.c:1769:44: runtime error: signed integer overflow:
-281474976710656 - 9223372036854775807 cannot be represented in type 'long'
../../gcc/gcc/postreload.c:1769:44: runtime error: signed integer overflow:
4

[Bug tree-optimization/57698] rev.200179 causes many errors (inlining failures) when building Firefox

2013-07-18 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57698

Markus Trippelsdorf  changed:

   What|Removed |Added

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

--- Comment #11 from Markus Trippelsdorf  ---
(In reply to Sriraman Tallam from comment #10)
> Patch committed. This should fix this.
> 
> Sri

Thanks Sri.


[Bug tree-optimization/57698] rev.200179 causes many errors (inlining failures) when building Firefox

2013-07-08 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57698

--- Comment #6 from Markus Trippelsdorf  ---
(In reply to Jan Hubicka from comment #3)
> Hmm,
> the problem here is that we output errors after early inlining always now,
> while previously we did
> only when some other inlining happened in the function (adding extra early
> inlinable function
> to the testcase should reproduce the error message on early GCC releases).
> We can fix by outputting always inline errors only after real inliner was
> run (when optimizing)
> but then such testcases won't compile at -O0 that is uncool too.

I"m not sure if I understand you correctly, but the test-case compiles
just fine at -O0. So outputting the always inline errors only after the
real inliner was run should fix the issue. No?


[Bug c++/57729] Always inline: indirect function call with a yet undetermined callee

2013-06-26 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57729

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #3 from Markus Trippelsdorf  ---
See Bug 57698.


[Bug tree-optimization/57698] rev.200179 causes many errors (inlining failures) when building Firefox

2013-06-25 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57698

--- Comment #2 from Markus Trippelsdorf  ---
Here's a reduced example:

 % cat test.ii
typedef bool (*IsAcceptableThis) (const int &);
inline int
fn1 (IsAcceptableThis p1)
{
p1 (0);
return 0;
}

__attribute__ ((always_inline))
inline bool fn2 (const int &)
{
return 0;
}

void
fn3 ()
{
fn1 (fn2);
}

 % g++ -c -O2 test.ii
test.ii: In function ‘void fn3()’:
test.ii:10:13: error: inlining failed in call to always_inline ‘bool fn2(const
int&)’: indirect function call with a yet undetermined callee
 inline bool fn2 (const int &)
 ^
test.ii:5:11: error: called from here
 p1 (0);
   ^

[Bug tree-optimization/57698] New: rev.200179 causes many errors (inlining failures) when building Firefox

2013-06-24 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57698

Bug ID: 57698
   Summary: rev.200179 causes many errors (inlining failures) when
building Firefox
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

I cannot build Firefox anymore with trunk because of inline errors, e.g.:

/home/markus/mozilla-central/js/src/jsapi.h: In function
‘js::regexp_exec(JSContext*, unsigned int, JS::Value*)’:
/home/markus/mozilla-central/js/src/builtin/RegExp.cpp:307:1: error: inlining
failed in call to always_inline ‘IsRegExp(JS::Value const&)’: indirect function
call with a yet undetermined callee
 IsRegExp(const Value &v)
 ^
In file included from /home/markus/mozilla-central/js/src/jsprvtd.h:24:0,
 from /home/markus/mozilla-central/js/src/builtin/RegExp.h:10,
 from /home/markus/mozilla-central/js/src/builtin/RegExp.cpp:7:
/home/markus/mozilla-central/js/src/jsapi.h:706:5: error: called from here
 if (Test(thisv))

IMO that is to aggressive (and will affect many projects). 
Wouldn't a simple warning be enough?

[Bug other/57324] New: Undefined behavior issues found with clang's -fsanitize=undefined

2013-05-18 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57324

Bug ID: 57324
   Summary: Undefined behavior issues found with clang's
-fsanitize=undefined
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: markus at trippelsdorf dot de

Here's a list of issues found with clang's -fsanitize=undefined
while building gcc-4.8.1:

gcc/gcc/config/i386/i386.c:21073:37: runtime error: left shift of negative
value -1073807360
gcc/gcc/cse.c:5384:31: runtime error: left shift of negative value -1
gcc/gcc/cselib.c:1118:43: runtime error: signed integer overflow: 3968 +
9223372036854775806 cannot be represented in type 'long'
gcc/gcc/dce.c:278:16: runtime error: left shift of negative value -1
gcc/gcc/double-int.c:150:13: runtime error: negation of -9223372036854775808
cannot be represented in type 'long'; cast to an unsigned type to negate this
value to itself
gcc/gcc/double-int.c:290:37: runtime error: left shift of negative value -1
gcc/gcc/dwarf2out.c:11223:61: runtime error: left shift of negative value -1
gcc/gcc/dwarf2out.c:11238:54: runtime error: left shift of negative value -1
gcc/gcc/expmed.c:2910:15: runtime error: left shift of negative value -1
gcc/gcc/expr.c:3861:17: runtime error: signed integer overflow: 0 -
-9223372036854775808 cannot be represented in type 'long'
gcc/gcc/fold-const.c:8032:8: runtime error: left shift of negative value -1
gcc/gcc/genattrtab.c:622:27: runtime error: signed integer overflow: 4568797 *
613 cannot be represented in type 'int'
gcc/gcc/genautomata.c:3495:23: runtime error: shift exponent 64 is too large
for 64-bit type 'set_el_t' (aka 'unsigned long')
gcc/gcc/haifa-sched.c:1132:24: runtime error: left shift of negative value -1
gcc/gcc/haifa-sched.c:1395:26: runtime error: left shift of negative value -1
gcc/gcc/ipa-inline-analysis.c:341:18: runtime error: shift exponent 32 is too
large for 32-bit type 'int'
gcc/gcc/ira-color.c:1359:29: runtime error: signed integer overflow: -130942930
* 1000 cannot be represented in type 'int'
gcc/gcc/postreload.c:1684:44: runtime error: signed integer overflow:
4611123068473966592 - -9223090561878065153 cannot be represented in type 'long'
gcc/gcc/real.c:2844:25: runtime error: left shift of negative value -1021
gcc/gcc/sched-deps.c:110:20: runtime error: left shift of negative value -1
gcc/gcc/simplify-rtx.c:1614:10: runtime error: negation of -9223372036854775808
cannot be represented in type 'long'; cast to an unsigned type to negate this
value to itself
gcc/gcc/simplify-rtx.c:4004:16: runtime error: signed integer overflow:
-1844674407370955161 + -9223372036854775808 cannot be represented in type
'long'
gcc/gcc/stor-layout.c:2543:45: runtime error: signed integer overflow:
-9223372036854775808 - 1 cannot be represented in type 'long'
gcc/gcc/stor-layout.c:2556:34: runtime error: left shift of negative value -1
gcc/gcc/stor-layout.c:2558:5: runtime error: left shift of negative value -1
gcc/gcc/tree.c:1873:32: runtime error: left shift of negative value -1
gcc/gcc/tree.c:1937:32: runtime error: left shift of negative value -1
gcc/gcc/tree.c:1974:32: runtime error: left shift of negative value -1
gcc/gcc/tree-ssa-structalias.c:1695:15: runtime error: left shift of negative
value -1
gcc/gcc/tree-ssa-structalias.c:6421:16: runtime error: left shift of negative
value -1
gcc/libcpp/files.c:675:30: runtime error: left shift of negative value -1
gcc/libiberty/regex.c:6970:11: runtime error: left shift of negative value -1
gcc/libiberty/regex.c:7165:4: runtime error: left shift of negative value -1


[Bug middle-end/55185] Error generated on extern inline function which isn't called

2013-05-12 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55185

--- Comment #3 from Markus Trippelsdorf  ---
markus@x4 ~ % cat test.i
extern double foo();
void bar() { foo(); }
markus@x4 ~ % gcc -m32 -O2 -mno-sse -c test.i
markus@x4 ~ % gcc -O2 -mno-sse -c test.i
test.i: In function ‘bar’:
test.i:2:17: error: SSE register return with SSE disabled
 void bar() { foo(); }
 ^
markus@x4 ~ % clang -O2 -mno-sse -c test.i
markus@x4 ~ %

[Bug middle-end/55185] Error generated on extern inline function which isn't called

2013-05-12 Thread markus at trippelsdorf dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55185

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot de

--- Comment #2 from Markus Trippelsdorf  ---
Ping.

I came across this issue while debugging a python problem.
Trying to compile python with "-mno-sse -mno-sse2 -mno-sse3 -mno-sse4a"
I get during configuration:
...
/usr/include/bits/stdlib-float.h: In function 'atof':
/usr/include/bits/stdlib-float.h:27:1: error: SSE register return with SSE
disabled


[Bug sanitizer/56630] gcc's address-sanitizer uses 75% more memory than clang's on simple testcase

2013-05-08 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||WONTFIX



--- Comment #3 from Markus Trippelsdorf  
2013-05-08 11:18:45 UTC ---

No reaction, closing.


[Bug sanitizer/56628] "bootstrap-lto bootstrap-asan" / profiledbootstrap fails

2013-05-08 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||WONTFIX



--- Comment #3 from Markus Trippelsdorf  
2013-05-08 11:19:06 UTC ---

No reaction, closing.


[Bug c++/57107] tree check fail in unlink_stmt_vdef

2013-04-29 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-04-29 09:00:33 UTC ---

Reduced:



class A {

public:

  template  struct rebind {

typedef A other;

  };

  ~A() {}

};

template  struct __alloc_traits {

  template  struct rebind {

typedef typename _Alloc::template rebind<_Tp>::other other;

  };

};

template  struct B {

  typedef typename __alloc_traits<_Alloc>::template rebind<_Tp>::other

  _Tp_alloc_type;

  struct C : _Tp_alloc_type {

C(_Tp_alloc_type) : _Tp_alloc_type() {}

  };

  typedef _Alloc allocator_type;

  B(int, const allocator_type &p2) : _M_impl(p2) {}

  C _M_impl;

};

template  class D : B<_Tp, _Alloc> {

  typedef B<_Tp, _Alloc> _Base;

public:

  typedef _Tp value_type;

  typedef _Alloc allocator_type;

  D(const value_type &p1, const allocator_type &p2 = allocator_type())

  : _Base(0, p2) {

_M_fill_initialize(p1);

  }

  void _M_fill_initialize(const value_type &);

};

void _setjmp();

void writeQImageToPng() {

  _setjmp();

  D(0);

}


[Bug c++/56895] [4.8/4.9 Regression] ICE: unexpected expression of kind arrow_expr

2013-04-10 Thread markus at trippelsdorf dot de


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



--- Comment #13 from Markus Trippelsdorf  
2013-04-10 20:04:03 UTC ---

struct B

{

void operator<< (B& ());

void operator<< (int);

};

B b;

struct A

{

bool foo ();

A bar ();

};

A *a;

template 

void

fn1 ()

{

b << (a->bar().foo() ? : 0);

}


[Bug c++/56895] [4.8/4.9 Regression] ICE: unexpected expression of kind arrow_expr

2013-04-10 Thread markus at trippelsdorf dot de

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

--- Comment #12 from Markus Trippelsdorf  
2013-04-10 19:56:00 UTC ---
Just double checked and the original testcase still ICEs.

markus@x4 tmp % cat test.cpp
#include 
extern struct A { bool foo (); A bar (); } *a;
template  
void
fn1 ()
{
  std::cout << (a->bar().foo() ? 1 : 0);
}

markus@x4 tmp % c++ -c test.cpp
test.cpp: In function ‘void fn1()’:
test.cpp:7:39: internal compiler error: unexpected expression ‘a->’ of kind
arrow_expr

[Bug c++/56911] [4.8 Regression] g++.dg/cpp0x/enum25.C:14:19: ICE: in finish_class_member_access_expr, at cp/typeck.c:2673 with -fpic

2013-04-10 Thread markus at trippelsdorf dot de


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



--- Comment #4 from Markus Trippelsdorf  
2013-04-10 18:42:07 UTC ---

gcc version 4.8.0 (GCC) in my case.


[Bug c++/56911] [4.8 Regression] g++.dg/cpp0x/enum25.C:14:19: ICE: in finish_class_member_access_expr, at cp/typeck.c:2673 with -fpic

2013-04-10 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-04-10 18:33:50 UTC ---

Hmm, I can confirm the ICE (and it's not the only one in this directory):



 % g++ -c -fpic -std=c++11 gcc/testsuite/g++.dg/cpp0x/*.C 2>&1 | grep internal

gcc/testsuite/g++.dg/cpp0x/constexpr-array5.C:6:23: internal compiler error:

Segmentation fault

gcc/testsuite/g++.dg/cpp0x/constexpr-reinterpret1.C:37:49: internal compiler

error: in gimple_expand_cfg, at cfgexpand.c:4575

gcc/testsuite/g++.dg/cpp0x/constexpr-static11.C:8:36: internal compiler error:

Segmentation fault

gcc/testsuite/g++.dg/cpp0x/constexpr-template5.C:6:29: internal compiler error:

in convert_nontype_argument, at cp/pt.c:5558

gcc/testsuite/g++.dg/cpp0x/enum25.C:14:19: internal compiler error: in

finish_class_member_access_expr, at cp/typeck.c:2673

gcc/testsuite/g++.dg/cpp0x/nsdmi-local.C:7:12: internal compiler error: in

expand_expr_real_1, at expr.c:9327

gcc/testsuite/g++.dg/cpp0x/range-for23.C:6:20: internal compiler error:

Segmentation fault

gcc/testsuite/g++.dg/cpp0x/trailing9.C:10:14: internal compiler error: in

cp_parser_late_return_type_opt, at cp/parser.c:16970


[Bug c/56903] gcc is 4.8.0 fails to compile netdev.c from the linux kernel [internal compiler error: Maximum number of LRA constraint passes is achieved]

2013-04-10 Thread markus at trippelsdorf dot de

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot
   ||de

--- Comment #2 from Markus Trippelsdorf  
2013-04-10 11:49:35 UTC ---
Reduced:

markus@x4 linux % cat test.i
extern int fn3(),fn4();
struct
{
int data_len;
}
*b;
struct tcphdr
{
int doff:1;
};
int a, c;
struct tcphdr *fn1 ();
void fn2 ()
{
int d, e = fn3 ();
char f;
d = fn1 ()->doff * 4;
f = c + d;
if (b->data_len && f == e)
a = (
{
b->data_len;
}
);
fn4 (b);
}
markus@x4 linux % gcc -Os -m32 -mtune=pentium3 -c test.i
test.i: In function ‘fn2’:
test.i:26:1: internal compiler error: Maximum number of LRA constraint passes
is achieved (30)

[Bug c++/56895] ICE: unexpected expression of kind arrow_expr

2013-04-09 Thread markus at trippelsdorf dot de

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot
   ||de

--- Comment #1 from Markus Trippelsdorf  
2013-04-09 16:11:24 UTC ---
A bit more reduced:
 % cat test.ii
struct A
{
int *foo ();
A bar ();
}
*a;

template  void
fn1 ()
{
0 << (a->bar().foo() ? 1 : 0);
}

 % c++ -c test.ii
test.ii: In function ‘void fn1()’:
test.ii:11:33: internal compiler error: unexpected expression ‘a->’ of kind
arrow_expr
 0 << (a->bar().foo() ? 1 : 0);

[Bug c++/56671] Gcc uses large amounts of memory and processor power with large C++11 bitsets

2013-03-21 Thread markus at trippelsdorf dot de


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



--- Comment #1 from Markus Trippelsdorf  
2013-03-21 08:31:57 UTC ---

Created attachment 29703

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29703

callgraph



Looks like a bug in constant expression handling.



perf shows:

 15.51%   cc1plus  cc1plus[.] gt_ggc_mx_lang_tree_node(void*)

 11.14%   cc1plus  cc1plus[.] walk_tree_1(tree_node**, tree_node*

(*)(tree_node**, int*, void*), void*, pointer_set_t*, tree_node*

(*)(tree_node**, int*, tree_no

  9.54%   cc1plus  cc1plus[.] htab_expand.1557810

  7.28%   cc1plus  cc1plus[.] ggc_set_mark(void const*)

  6.35%   cc1plus  cc1plus[.] lookup_page_table_entry(void const*)

[clone .218759]

  6.32%   cc1plus  cc1plus[.] build_int_cst(tree_node*, long)

  5.07%   cc1plus  [kernel.kallsyms]  [k] clear_page_c

  3.60%   cc1plus  cc1plus[.]

initializer_constant_valid_p_1(tree_node*, tree_node*, tree_node**) [clone

.1222026]

  3.46%   cc1plus  cc1plus[.] mostly_copy_tree_r(tree_node**, int*,

void*) [clone .459380]

  2.57%   cc1plus  cc1plus[.] gt_ggc_mx(constructor_elt_d&)

  2.21%   cc1plus  cc1plus[.] vec::copy() const [clone .local.823]

  1.97%   cc1plus  cc1plus[.] int_cst_hash_hash(void const*) [clone

.1202876]

  1.94%   cc1plus  cc1plus[.] cxx_eval_vec_init_1(constexpr_call

const*, tree_node*, tree_node*, bool, bool, bool, bool*, bool*) [clone

.109131.20812] 





cxx_eval_outermost_constant_expr -> cxx_eval_constant_expression ->

-> cxx_eval_vec_init_1 -> build_int_cst 

(see attached callgraph)


[Bug c++/56652] Wrong code in O2 - if in inline function

2013-03-18 Thread markus at trippelsdorf dot de


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



--- Comment #5 from Markus Trippelsdorf  
2013-03-18 12:33:50 UTC ---

(In reply to comment #4)

> (In reply to comment #2)

> > Quick check with clang -fsanitize=undefined shows:

> > ...

> > numeric.cc:47:30: fatal error: negation of -2147483648 cannot be 
> > represented in

> > type 'int'; cast to an unsigned type to negate this value to itself

> > 

> > Thus invalid.

> 

> Thank you. OK, works if I change type of count and size to unsigned.

> So INT_MIN has wrong value?



-INT_MIN is an integer overflow and is undefined behavior in C.

http://www.google.com/search?hl=en&q=+INT_MIN


[Bug c++/56652] Wrong code in O2 - if in inline function

2013-03-18 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-03-18 12:15:21 UTC ---

Quick check with clang -fsanitize=undefined shows:

...

numeric.cc:47:30: fatal error: negation of -2147483648 cannot be represented in

type 'int'; cast to an unsigned type to negate this value to itself



Thus invalid.


[Bug c/56635] [4.8 regression] internal compiler error: in find_lattice_value, at tree-complex.c:15

2013-03-16 Thread markus at trippelsdorf dot de

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot
   ||de

--- Comment #3 from Markus Trippelsdorf  
2013-03-17 04:44:38 UTC ---
markus@x4 tmp % cat test.ii
templatestruct A;
templateA<_Tp>operator/(A<_Tp>, A<_Tp>& p2)
{
  A<_Tp> a;
  a /= p2;
  return a;
}

templatebool operator!=(A<_Tp>& p1, A<_Tp>&)
{
  return p1.real();
}

template<>struct A
{
  double& real()
  {
return __real__ _M_value;
  }

  templatevoid operator/=(A<_Tp>&)
  {
_M_value /= 10;
  }

  _Complex double _M_value;
};

templateclass B {
  T *buf;

public:

  B(int, bool);
  T& operator[](int)
  {
return buf[0];
  }
};

struct C
{
  C(const int&);
  typedef ATy;
  typedef BDataT;
  Azero;
  enum InitType
  { NOZERO };
  virtual C* DivInv(C *);
};
templateclass D : Sp {
  typedef typename Sp::TyTy;
  typedef typename Sp::DataT DataT;
  DataT dd;

public:

  D(const int&, C::InitType);
  Ty& operator[](int)
  {
return dd[0];
  }

  D* DivInv(C *);
};

templateD *D::DivInv(C *)
{
  if ((*this)[0] != this->zero) (*this)[0] = (*static_cast(0))[0] /
 (*this)[0];
  else (*this)[0] = (*static_cast(0))[0];
  return 0;
}

D *b = new D(0, C::NOZERO);
templateD::D(const int&, C::InitType) : Sp(0), dd(0, 0)
{}

markus@x4 tmp % c++ -Wextra -Wall -c -O3 test.ii
test.ii: In member function ‘D* D::DivInv(C*) [with Sp = C]’:
test.ii:67:26: internal compiler error: in find_lattice_value, at
tree-complex.c:151
 templateD *D::DivInv(C *)
  ^


[Bug sanitizer/56630] gcc's address-sanitizer uses 75% more memory than clang's on simple testcase

2013-03-16 Thread markus at trippelsdorf dot de


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



--- Comment #2 from Markus Trippelsdorf  
2013-03-16 10:30:51 UTC ---

Looks like the sorting of a std::list container is mostly responsible:

  168 list container(first, last);

  169 container.sort();



When I run just with size 10 I get:



markus@x4 ~ % c++ -O2 -fsanitize=address bench.cpp

markus@x4 ~ % time ./mem ./a.out

sizearray   vector with pointersvector with iterators   deque  

10  0.470.480.541.06

listset multiset

13.69(!)2.413.97

./mem ./a.out  21.80s user 0.99s system 99% cpu 22.791 total

peak=2736348  



Without the list test I get a reasonable result:

(238 //run(list_test, buffer, buffer_end, n);)



markus@x4 ~ % time ./mem ./a.out

sizearray   vector with pointersvector with iterators

10  0.460.470.5

deque   set multiset

1.031.933.71

./mem ./a.out  7.67s user 0.56s system 99% cpu 8.245 total

markus@x4 ~ % memusg: peak=1415416



For comparison clang:

markus@x4 ~ % clang++ -O2 -fsanitize=address bench.cpp

markus@x4 ~ % time ./mem ./a.out

sizearray   vector with pointersvector with iterators  deque

10  0.420.410.42   0.96

list   set multiset

5.732.935.69

./mem ./a.out  16.52s user 0.10s system 99% cpu 16.627 total

markus@x4 ~ % memusg: peak=229660


[Bug sanitizer/56630] gcc's address-sanitizer uses 75% more memory than clang's on simple testcase

2013-03-16 Thread markus at trippelsdorf dot de


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



--- Comment #1 from Markus Trippelsdorf  
2013-03-16 08:24:56 UTC ---

Created attachment 29676

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29676

simple c++ std. container  benchmark


[Bug sanitizer/56630] New: gcc's address-sanitizer uses 75% more memory than clang's on simple testcase

2013-03-16 Thread markus at trippelsdorf dot de


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



 Bug #: 56630

   Summary: gcc's address-sanitizer uses 75% more memory than

clang's on simple testcase

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: sanitizer

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: mar...@trippelsdorf.de

CC: do...@gcc.gnu.org, dvyu...@gcc.gnu.org,

ja...@gcc.gnu.org, k...@gcc.gnu.org





markus@x4 ~ % c++ -O2 -fsanitize=address bench.cpp

markus@x4 ~ % time ./a.out

...

./a.out  61.65s user 1.10s system 100% cpu 1:02.75 total

UIDPID  PPID  CSZ   RSS PSR STIME TTY  TIME CMD

markus3810 22602 99 4563582920 3183864 1 09:15 pts/12 00:01:02 ./a.out





markus@x4 ~ % clang++ -O2 -fsanitize=address bench.cpp

markus@x4 ~ % time ./a.out

...

./a.out  64.04s user 0.29s system 100% cpu 1:04.31 total

UIDPID  PPID  CSZ   RSS PSR STIME TTY  TIME CMD

markus3722 22602 99 4295159814 784236 0 09:13 pts/12 00:01:01 ./a.out


[Bug sanitizer/56628] "bootstrap-lto bootstrap-asan" / profiledbootstrap fails

2013-03-16 Thread markus at trippelsdorf dot de


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



--- Comment #2 from Markus Trippelsdorf  
2013-03-16 08:08:09 UTC ---

The "bootstrap-asan/profiledbootstrap" issue looks like dup of Bug 56535.



And please ignore my remark about the huge size of SZ.


[Bug sanitizer/56535] ICE: in build2_stat, at tree.c:3885 when compiling with -fsanitize=address

2013-03-16 Thread markus at trippelsdorf dot de

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot
   ||de

--- Comment #1 from Markus Trippelsdorf  
2013-03-16 08:04:07 UTC ---
Also happens during --with-build-config="bootstrap-asan" and profiledbootstrap 
with -enable-languages=c,c++:

/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/home/markus/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c -march=native -O3 -pipe -fsanitize=address -fprofile-use -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE
-I. -Ibuild -I/home/markus/gcc/gcc -I/home/markus/gcc/gcc/build
-I/home/markus/gcc/gcc/../include -I/home/markus/gcc/gcc/../libcpp/include
-I/home/markus/gcc/gcc/../libdecnumber
-I/home/markus/gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/markus/gcc/gcc/../libbacktrace -o build/genmodes.o
/home/markus/gcc/gcc/genmodes.c

/home/markus/gcc/gcc/genmodes.c: In function ‘void
_ZL18make_complex_modes10mode_classPKcj.constprop.2(mode_class, unsigned int)’:
/home/markus/gcc/gcc/genmodes.c:423:1: internal compiler error: in build2_stat,
at tree.c:3885
 make_complex_modes (enum mode_class cl,
 ^


[Bug sanitizer/56628] "bootstrap-lto bootstrap-asan" / profiledbootstrap fails

2013-03-15 Thread markus at trippelsdorf dot de

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

--- Comment #1 from Markus Trippelsdorf  
2013-03-16 03:49:05 UTC ---
With --with-build-config="bootstrap-asan" and profiledbootstrap I get an ICE:

/var/tmp/gcc_build_dir/./prev-gcc/xg++ -B/var/tmp/gcc_build_dir/./prev-gcc/
-B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/home/markus/gcc/libstdc++-v3/libsupc++
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/var/tmp/gcc_build_dir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c -march=native -O3 -pipe -fsanitize=address -fprofile-use -DIN_GCC
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE
-I. -Ibuild -I/home/markus/gcc/gcc -I/home/markus/gcc/gcc/build
-I/home/markus/gcc/gcc/../include -I/home/markus/gcc/gcc/../libcpp/include
-I/home/markus/gcc/gcc/../libdecnumber
-I/home/markus/gcc/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/markus/gcc/gcc/../libbacktrace -o build/genmodes.o
/home/markus/gcc/gcc/genmodes.c
   
/home/markus/gcc/gcc/genmodes.c: In function ‘void
_ZL18make_complex_modes10mode_classPKcj.constprop.2(mode_class, unsigned int)’:
/home/markus/gcc/gcc/genmodes.c:423:1: internal compiler error: in build2_stat,
at tree.c:3885
 make_complex_modes (enum mode_class cl,
 ^


[Bug sanitizer/56628] New: "bootstrap-lto bootstrap-asan" / profiledbootstrap fails

2013-03-15 Thread markus at trippelsdorf dot de


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



 Bug #: 56628

   Summary: "bootstrap-lto  bootstrap-asan" / profiledbootstrap

fails

Classification: Unclassified

   Product: gcc

   Version: 4.8.0

Status: UNCONFIRMED

  Severity: normal

  Priority: P3

 Component: sanitizer

AssignedTo: unassig...@gcc.gnu.org

ReportedBy: mar...@trippelsdorf.de

CC: do...@gcc.gnu.org, dvyu...@gcc.gnu.org,

ja...@gcc.gnu.org, k...@gcc.gnu.org





During stagefeedback:

...

/usr/x86_64-pc-linux-gnu/bin/ld: error:

/var/tmp/gcc_build_dir/./prev-gcc/liblto_plugin.so: could not load plugin

library: /var/tmp/gcc_build_dir/./prev-gcc/liblto_plugin.so:

 undefined symbol: __asan_report_load8



Also the size in physical pages of the instrumented gcc during the build

is insane:



 % ps afx -F

UIDPID  PPID  CSZ   RSS PSR STIME TTY  STAT   TIME CMD

...

markus 447   432  0  5080  6760   1 12:11 pts/7Ss 0:00  \_ zsh

markus   21960   447  0  2864  2380   3 21:05 pts/7SN+0:00  |   \_ make

-j4 BOOT_CFLAGS=-march=native -O3 -pipe STAGE1_CFLAGS=-march=native -O3 -pipe

CFLAGS_FOR_TARGE

markus   21970 21960  0  2233  1576   2 21:05 pts/7SN+0:00  |   \_

/bin/sh -c r=`${PWDCMD-pwd}`; export r; \ s=`cd /home/markus/gcc;

${PWDCMD-pwd}`; export s; \ m

markus   21982 21970  0  2868  2580   0 21:05 pts/7SN+0:00  |  

\_ make DESTDIR= RPATH_ENVVAR=LD_LIBRARY_PATH TARGET_SUBDIR=x86_64-pc-linux-gnu

bindir=/usr/x8

markus7754 21982  0  2267  1640   2 21:10 pts/7SN+0:00  |  

\_ /bin/sh -c r=`${PWDCMD-pwd}`; export r; \ s=`cd /home/markus/gcc;

${PWDCMD-pwd}`; expor

markus7822  7754  0  2900  2800   3 21:10 pts/7SN+0:00  |  

\_ make DESTDIR= RPATH_ENVVAR=LD_LIBRARY_PATH

TARGET_SUBDIR=x86_64-pc-linux-gnu bindir

markus   32484  7822  0  2268  1708   0 21:21 pts/7SN+0:00  |  

\_ /bin/sh -c r=`${PWDCMD-pwd}`; export r; \ s=`cd

/home/markus/gcc; ${PWDCMD-pwd}

markus   32502 32484  0  2868  2696   1 21:21 pts/7SN+0:00  |  

\_ make DESTDIR= RPATH_ENVVAR=LD_LIBRARY_PATH

TARGET_SUBDIR=x86_64-pc-linux-gn

markus1340 32502  0 4563418731 103424 0 21:22 pts/7 SN+   0:00  |  

\_ /var/tmp/gcc_build_dir/./gcc/xgcc

-B/var/tmp/gcc_build_dir/./gcc/ -B/us

markus1341  1340  0 4563438756 256712 0 21:22 pts/7 RN+   0:00  |  

|   \_ /var/tmp/gcc_build_dir/./gcc/cc1 -quiet -I . -I . -I

../.././gcc -I

markus1342  1340  0 0 0   0 21:22 pts/7ZN+0:00  |  

|   \_ [as] 

markus1344 32502  0 4563418731 105476 2 21:22 pts/7 SN+   0:00  |  

\_ /var/tmp/gcc_build_dir/./gcc/xgcc

-B/var/tmp/gcc_build_dir/./gcc/ -B/us

markus1346  1344  0 4563438755 154848 2 21:22 pts/7 RN+   0:00  |  

|   \_ /var/tmp/gcc_build_dir/./gcc/cc1 -quiet -I . -I . -I

../.././gcc -I

markus1349  1344  0  3510  6004   2 21:22 pts/7SN+0:00  |  

|   \_ /usr/x86_64-pc-linux-gnu/bin/as -I . -I . -I

../.././gcc -I /home/m

markus1345 32502  0 4563418731 105480 3 21:22 pts/7 SN+   0:00  |  

\_ /var/tmp/gcc_build_dir/./gcc/xgcc

-B/var/tmp/gcc_build_dir/./gcc/ -B/us

markus1347  1345  0 4563438755 170160 3 21:22 pts/7 RN+   0:00  |  

|   \_ /var/tmp/gcc_build_dir/./gcc/cc1 -quiet -I . -I . -I

../.././gcc -I

markus1348  1345  0  3510  6008   0 21:22 pts/7SN+0:00  |  

|   \_ /usr/x86_64-pc-linux-gnu/bin/as -I . -I . -I

../.././gcc -I /home/m

markus1352 32502  0 4563418731 103424 1 21:22 pts/7 SN+   0:00  |  

\_ /var/tmp/gcc_build_dir/./gcc/xgcc

-B/var/tmp/gcc_build_dir/./gcc/ -B/us

markus1353  1352  0 4563437582 151104 1 21:22 pts/7 RN+   0:00  |  

\_ /var/tmp/gcc_build_dir/./gcc/cc1 -quiet -I . -I . -I

../.././gcc -I

markus1354  1352  0  3510  6004   0 21:22 pts/7SN+0:00  |  

\_ /usr/x86_64-pc-linux-gnu/bin/as -I . -I . -I

../.././gcc -I /home/m

...


[Bug other/56579] 4.8.0-20130303 g++ optimisation flags cause segfault or different program output

2013-03-09 Thread markus at trippelsdorf dot de


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



--- Comment #4 from Markus Trippelsdorf  
2013-03-09 16:51:52 UTC ---

(In reply to comment #3)

> (In reply to comment #2)

> > That most likely means that the programm is invoking undefined

> > behaviour and thus invalid.

> > 

> > A quick check with "clang++ -fsanitize=undefined" confirms this:

> > ...

> >  paq8kx_v7.cpp:1795:13: fatal error: signed integer overflow: 707863021 * 8

> > cannot be represented in type 'int'

> 

> Thanks for your further investigation.

> 

> Clearly an error in the program code then.

> 

> Shall I change status of bug to RESOLVED? (assuming that's

> how I close the bug?)



Yes, RESOLVED->INVALID.


[Bug other/56579] 4.8.0-20130303 g++ optimisation flags cause segfault or different program output

2013-03-09 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-03-09 16:22:19 UTC ---

(In reply to comment #1)

> Something in the back of my mind has since reminded

> me of -fno-aggressive-loop-optimizations, and compiling

> at (e.g.) -O3 using -fno-aggressive-loop-optimizations

> no longer segfaults and produces the expected output.



That most likely means that the programm is invoking undefined

behaviour and thus invalid.



A quick check with "clang++ -fsanitize=undefined" confirms this:

...

 paq8kx_v7.cpp:1795:13: fatal error: signed integer overflow: 707863021 * 8

cannot be represented in type 'int'


[Bug middle-end/56559] [4.8 Regression] ICE in propagate_op_to_single_use, at tree-ssa-reassoc.c:1057

2013-03-06 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||wschmidt at linux dot

   ||vnet.ibm.com



--- Comment #3 from Markus Trippelsdorf  
2013-03-07 06:58:27 UTC ---

Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186567


[Bug middle-end/56559] [4.8 Regression] ICE in propagate_op_to_single_use, at tree-ssa-reassoc.c:1057

2013-03-06 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-03-07 06:28:13 UTC ---

reduced test case:



double a, b, c, d, e;

void

fn1 ()

{

a = e * e;

b = d * e + c * e * a;

}


[Bug c++/56545] internal compiler error: in build_data_member_initialization, at cp/semantics.c:5790

2013-03-05 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #2 from Markus Trippelsdorf  
2013-03-05 19:03:01 UTC ---

Probably dup of Bug 54126.



Reduced:



templatestruct StringyInterface

{};

templatestruct StringyImplementation;

template<>struct StringyImplementation: StringyInterface

{};

templatestruct Stringy

{

  const StringyInterface& verifyConforms =

StringyImplementation();

};

void

fn1()

{

  Stringy().verifyConforms;

}


[Bug c++/56395] [4.7/4.8 Regression] ICE, Segmentation fault in tsubst

2013-02-20 Thread markus at trippelsdorf dot de


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



--- Comment #7 from Markus Trippelsdorf  
2013-02-20 12:40:01 UTC ---

Still more reduced:



templatestruct I

{

  typedef T type;

};

struct H

{

  typedef int ChildOnCIter;

};

templatestruct C;

template<>struct C

{

  templatestruct G

  {

typedef typename Sequence::tag type;

  };

};

templatestruct O : C<0>::G

{};

templatestruct W;

templatestruct P : W

::type>::template X

{};

template<>struct W

{

  templatestruct X : I

  {};

};

templatestruct R : Base

{};

templatestruct V;

template<>struct V<>

{

  typedef int tag;

};

struct S : R >

{};

templatestruct IterTraits

{

  templatestruct K

  {

typedef OtherNodeT Type;

  };

};

templatestruct B

{

  typedef typename PrevItemT::IterT  PrevIterT;

  typedef typename P::type _NodeT;

  typedef typename IterTraits::template K< _NodeT>::Type IterT;

  IterTraitsITraits;

};

templatestruct B

{

  typedef typename PrevItemT::IterT  PrevIterT;

  typedef typename P::type _NodeT;

  typedef typename IterTraits::template K<

  _NodeT>::Type IterT;

  IterTraits ITraits;

};

templatestruct N

{

  typedef RootChildOnIterT RootIterT;

  struct M

  {

typedef RootIterT IterT;

  };

  BmIterList;

};

templatestruct D

{

  NLeafCIter;

};

D a;


[Bug c++/56395] [4.7/4.8 Regression] ICE, Segmentation fault in tsubst

2013-02-20 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #6 from Markus Trippelsdorf  
2013-02-20 12:19:47 UTC ---

A little bit further reduced:



template < typename T > struct I

{

  typedef T type;

};

template < typename T > struct F

{

  typedef T type;

};

template < typename ChildType > struct H

{

  typedef ChildType ChildNodeType;

template < typename RootNodeT > struct A

  {

typedef RootNodeT NodeType;

typedef typename F < NodeType >::type NonConstNodeType;

  };

  typedef A < H > ChildOnCIter;

};

template < bool > struct C;

template <> struct C 

{

  template < typename Sequence > struct G

  {

typedef typename Sequence::tag type;

  };

};

template < typename Sequence > struct O:C < 0 >::G < Sequence >

{

};

template < typename > struct W;

template < typename Sequence > struct P:W < typename O <

  Sequence >::type >::template X < Sequence >

{

};

template < typename > struct L;

template < typename Sequence,

  typename T > struct Q:L < typename O < Sequence >::type >

::template X < Sequence, T >

{

};

template <> struct W 

{

  template < typename Vector > struct X:I < Vector >

  {

  };

};

template < typename Base > struct R:Base

{

};

template < typename = int > struct V;

template <> struct V <>

{

  typedef int tag;

};

struct S:R < V <> >

{

};

template < typename HeadT, int > struct J

{

  typedef typename J < typename HeadT::ChildNodeType, 1 >::Type SubtreeT;

  typedef typename Q < SubtreeT, HeadT >::type Type;

};

template < typename HeadT > struct J 

{

  typedef S Type;

};

template < typename > struct IterTraits

{

  template < typename OtherNodeT > struct K

  {

typedef OtherNodeT Type;

  };

};

template < typename PrevItemT, typename NodeVecT, int > struct B

{

  typedef typename PrevItemT::IterT PrevIterT;

  typedef typename P < NodeVecT >::type _NodeT;

  typedef typename IterTraits < PrevIterT >::template K < _NodeT >::Type IterT;

IterTraits < IterT > ITraits;

};

template < typename PrevItemT, typename NodeVecT > struct B 

{

  typedef typename PrevItemT::IterT PrevIterT;

  typedef typename P < NodeVecT >::type _NodeT;

  typedef typename IterTraits < PrevIterT >::template K < _NodeT >::Type IterT;

IterTraits < IterT > ITraits;

};

template < typename RootChildOnIterT > struct N

{

  typedef RootChildOnIterT RootIterT;

  typedef typename RootIterT::NonConstNodeType NCRootNodeT;

  typedef typename J < NCRootNodeT, 0 >::Type InvTreeT;

  struct M

  {

typedef RootIterT IterT;

  };

B < M, InvTreeT, 0 > mIterList;

};

template < typename T > struct D

{

  N < typename T::ChildOnCIter > LeafCIter;

};

D < H < int > >a;


[Bug c++/56268] [4.7/4.8 Regression] C++11 ICE with boost multi-precision and boost variant during assignment

2013-02-10 Thread markus at trippelsdorf dot de


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



--- Comment #2 from Markus Trippelsdorf  
2013-02-10 12:42:24 UTC ---

Created attachment 29410

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29410

Somewhat reduced testcase



[Bug sanitizer/55309] gcc's address-sanitizer 66% slower than clang's

2013-02-05 Thread markus at trippelsdorf dot de


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



--- Comment #12 from Markus Trippelsdorf  
2013-02-05 11:17:42 UTC ---

(In reply to comment #9)

> > And, for compile time, you want to be testing with --enable-checking=release

> Thanks! 

> With --enable-checking=release gcc's compile time drops to 374 seconds.

> That's much better, but still 50% slower than clang (built with asserts)



Hmm, that means gcc is 35% slower (374 vs. 243). That is exactly the

slowdown that I see in all my tests. (So switching to clang is like

moving from a 4-core to a 6-core machine from a compile time perspective.)


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2013-01-09 Thread markus at trippelsdorf dot de


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



--- Comment #167 from Markus Trippelsdorf  
2013-01-09 19:58:33 UTC ---

(In reply to comment #166)

> Markus, the apperance of undefined references I fixed by patch above is highly

> sensitive to partitioning and inlining decision.  Can you, please, check if 
> the

> problem with PGO remains?  It may be another instance of the same issue.



Just checked it using your patch from comment 165, but the issue from

comment 162 is still there:



/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:

error: /tmp/ccACx905.ltrans6.ltrans.o: requires dynamic R_X86_64_PC32 reloc

against '_ZN13nsXULDocument14MaybeBroadcastEv.466048' which may overflow at

runtime; recompile with -fPIC

/tmp/ccACx905.ltrans6.ltrans.o:ccACx905.ltrans6.o:function

nsRunnableMethodTraits::base_type* NS_N

ewRunnableMethod(nsXULDocument*,

void (nsXULDocument::*)()) [clone .local.42120] [clone .constprop.89117]:

error: undefined reference to 'nsXULDocument::MaybeBroadcast() [clone .466048]'

/tmp/ccACx905.ltrans6.ltrans.o:ccACx905.ltrans6.o:function

nsRunnableMethodTraits::base_type* NS_N

ewRunnableMethod(nsXULDocument*,

void (nsXULDocument::*)()) [clone .local.42120] [clone 

.constprop.89117]: error: undefined reference to

'nsXULDocument::MaybeBroadcast() [clone .466048]'



Also the memory usage went through the roof (not sure if this caused

by your patch or my recent git-pull of mozilla-central): 

over 9GB RAM is needed (not much fun on my 8GB test-machine).



(So I will stop testing Firfox for now, until LTO/PGO memory usage

gets sane again (hopefully for 4.9).)


[Bug regression/55759] bogus warning when building drivers/ata/libata-core.c in v3.7 of the linux kernel

2012-12-20 Thread markus at trippelsdorf dot de

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

--- Comment #4 from Markus Trippelsdorf  
2012-12-20 18:34:19 UTC ---
This is what creduce came up with:

markus@x4 /tmp % cat test.i
struct ata_taskfile
{
int feature;
};
struct ata_eh_info
{
int flags;
};
struct ata_eh_context
{
struct ata_eh_info i;
};
struct
{
struct ata_eh_context eh_context;
}
g, n;
int a, c, e, f, m, o;
void fn1 (char *, ...);
int fn2 ();
int fn3 ();
static int
fn4 (long long *p1)
{
struct ata_taskfile b;
if (a && b.feature)
return 1;
*p1 = fn3 ();
return 0;
}

static int
fn5 ()
{
struct ata_taskfile d;
if (c && d.feature)
return -13;
return 0;
}

static int
fn6 ()
{
struct ata_eh_context h = g.eh_context;
int i = h.i.flags, l;
_Bool j = f;
long long k;
l = fn4 (&k);
if (l)
return 0;
if (e || j)
return 0;
l = fn5 ();
if (l == -13)
return 0;
if (l)
return 1;
l = fn2 ();
if (l)
if (i)
fn1 ("HPA  >   %llu\n", k);
return 0;
}

int
fn7 ()
{
struct ata_eh_context p = n.eh_context;
int q = p.i.flags;
o = 0;
m = fn6 ();
goto err_out_nosup;
if (q)
err_out_nosup:
return 0;
}
markus@x4 /tmp % gcc -c -Wall -Os test.i
test.i: In function ‘fn7’:
test.i:61:17: warning: ‘k’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
 fn1 ("HPA  >   %llu\n", k);
 ^
test.i:47:15: note: ‘k’ was declared here
 long long k;
   ^
markus@x4 /tmp % gcc -c -Wall test.i
markus@x4 /tmp % gcc -c -Wall -O2 test.i
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.6.3/gcc -c -Wall -Os test.i
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2/gcc -c -Wall -Os test.i
test.i: In function ‘fn7’:
test.i:61:17: warning: ‘k’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
test.i:47:15: note: ‘k’ was declared here
markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.7.2/gcc -c -Wall -O2 test.i
markus@x4 /tmp %


[Bug regression/55759] bogus warning when building drivers/ata/libata-core.c in v3.7 of the linux kernel

2012-12-20 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 CC||markus at trippelsdorf dot

   ||de



--- Comment #3 from Markus Trippelsdorf  
2012-12-20 16:38:04 UTC ---

It only happens with -Os, -O2 is fine.

gcc-4.8 is also affected.

I'm reducing this testcase right now.


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-18 Thread markus at trippelsdorf dot de


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



--- Comment #16 from Markus Trippelsdorf  
2012-12-18 17:03:52 UTC ---

I did some measurements with tramp3d and in this case

the default (999) gives the best performance:



par. sizetime



999  955859  3.71752

990  933390  3.73969

980  904718  3.84547

...""

750  904718  3.84769

740  837654  7.67177

600  836024  8.80879


[Bug c/55697] Another ice in remove_redundant_iv_tests

2012-12-14 Thread markus at trippelsdorf dot de


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



--- Comment #2 from Markus Trippelsdorf  
2012-12-14 21:35:08 UTC ---

It's a dup of PR55684 and it's already fixed...


[Bug c/55697] Another ice in remove_redundant_iv_tests

2012-12-14 Thread markus at trippelsdorf dot de

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 CC||markus at trippelsdorf dot
   ||de

--- Comment #1 from Markus Trippelsdorf  
2012-12-14 21:26:23 UTC ---
Reduced:

markus@x4 tmp % cat test.i
int a[0];
int
fn1 ()
{
int *b=0;
int i, j=0;
do
{
int n = *b++;
for (i = 0; i < 1; ++i)
n = *b++;
a[++j] = n - '0';
b -= 6;
}
while (b);
return 0;
}
markus@x4 tmp % gcc -c -O2 test.i
test.i: In function ‘fn1’:
test.i:3:1: internal compiler error: in remove_redundant_iv_tests, at
tree-ssa-loop-ivcanon.c:559


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-14 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||FIXED



--- Comment #14 from Markus Trippelsdorf  
2012-12-14 16:31:21 UTC ---

fixed


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #12 from Markus Trippelsdorf  
2012-12-13 22:35:33 UTC ---

(In reply to comment #11)

> Do you happen to know what it was with lto/pgo before the change? Should be

> roughly equivalent to hot-bb-count-ws-permille=970 from what I saw in your

> profiles



Yes, it was ~34MB before the change.



> What size increase is acceptable?



It's hard to say in case of Firefox, because the only thing

that one can reliably measure is the JavaScript performance.

And this varies only very slightly with different compiler options.

So you have no way to measure up to which point more inlining

is still beneficial.


[Bug lto/45375] [meta-bug] Issues with building Mozilla with LTO

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #162 from Markus Trippelsdorf  
2012-12-13 22:25:27 UTC ---

The libxul binary size issue is solved now.



During testing I came across another issue that looks similar 

to the one Comment 146:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/../../../../x86_64-pc-linux-gnu/bin/ld:

error: /tmp/ccwu5G98.ltrans4.ltrans.o: requires dynamic R_X86_64_PC32 reloc

against '_ZN13nsXUL

Document14MaybeBroadcastEv.429466' which may overflow at runtime; recompile

with -fPIC

/tmp/ccwu5G98.ltrans4.ltrans.o:ccwu5G98.ltrans4.o:function

nsRunnableMethodTraits::base_type*

NS_NewRunnableMethod(nsXULDocument*, void (nsXULDocument::*)()) [clone

.local.39398] [clone .constprop.84952]: error: undefined reference to

'nsXULDocument::MaybeBroadcast() [clone .429466]'

/tmp/ccwu5G98.ltrans4.ltrans.o:ccwu5G98.ltrans4.o:function

nsRunnableMethodTraits::base_type*

NS_NewRunnableMethod(nsXULDocument*, void (nsXULDocument::*)()) [clone

.local.39398] [clone .constprop.84952]: error: undefined reference to

'nsXULDocument::MaybeBroadcast() [clone .429466]'

collect2: error: ld returned 1 exit status



After I deleted both nsXULDocument.o and nsXULDocument.gcda and rebuild with:

 make -f client.mk realbuild MOZ_PROFILE_USE=1 

the problem did go away.


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #10 from Markus Trippelsdorf  
2012-12-13 22:14:01 UTC ---

(In reply to comment #8)

> Please let me know how this affects the mozilla size.



Looks much better now:

 39748288 hot-bb-count-ws-permille=999 (default)

 34573408 hot-bb-count-ws-permille=890

 34072808 without lto/pgo


[Bug lto/55669] [4.8 Regression] ICE : in cgraph_mark_address_taken_node, at cgraph.c:1409

2012-12-13 Thread markus at trippelsdorf dot de


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



Markus Trippelsdorf  changed:



   What|Removed |Added



 Status|UNCONFIRMED |RESOLVED

 Resolution||DUPLICATE



--- Comment #2 from Markus Trippelsdorf  
2012-12-13 19:10:40 UTC ---

Dup. Fixed by the patch in PR55674.



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


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #9 from Markus Trippelsdorf  
2012-12-13 19:10:40 UTC ---

*** Bug 55669 has been marked as a duplicate of this bug. ***


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #6 from Markus Trippelsdorf  
2012-12-13 15:06:12 UTC ---

(In reply to comment #5)

> Ok, I will download tramp3d-v4 right now and see what is going on. Can

> you send me the full set of options you are using to compile it?

> 



g++ -w -O3 -fprofile-generate -march=native tramp3d-v4.cpp

./a.out --cartvis 1.0 0.0 --rhomin 1e-8 -n 20 

g++ -w -O3 -fprofile-use -flto=4 -march=native tramp3d-v4.cpp


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #4 from Markus Trippelsdorf  
2012-12-13 14:52:37 UTC ---

(In reply to comment #3)

> Hi Markus,

> 

> Are you sure you have my subsequent fixes patched in, to make sure the

> histogram is getting streamed through the LTO files? This was the

> behavior I saw when I was debugging the original issue that I fixed

> with those patches. Basically, the hotness checks before we went into

> LTO were good, and after LTO the min count was 0.

> 

Hi Teresa,



yes my gcc is up-to-date (from todays git).


[Bug gcov-profile/55674] [4.8 Regression] >20% size increase of lto/pgo binaries since r193747

2012-12-13 Thread markus at trippelsdorf dot de


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



--- Comment #2 from Markus Trippelsdorf  
2012-12-13 14:46:31 UTC ---

In the tramp3d-v4 case, when I run with this simple debug patch:



diff --git a/gcc/predict.c b/gcc/predict.c

index 5d3de29..bf3a259 100644

--- a/gcc/predict.c

+++ b/gcc/predict.c

@@ -147,6 +147,7 @@ maybe_hot_count_p (struct function *fun, gcov_type count)

   gcc_assert (ws);

   min_count = ws->min_counter;

 }

+  fprintf (stderr, "count=%i min_count=%i profile_info->sum_max=%i\n", count,

min_count, profile_info->sum_max);

   return (count >= min_count);

 }



it shows that in the middle of the output, min_count changes from 

8585 to 0:



... ~60 similar lines with  min_count=8585

count=3 min_count=8585 profile_info->sum_max=257406300

count=3 min_count=8585 profile_info->sum_max=257406300

count=3 min_count=8585 profile_info->sum_max=257406300

count=3 min_count=8585 profile_info->sum_max=257406300

count=40 min_count=0 profile_info->sum_max=257406300

count=61 min_count=0 profile_info->sum_max=257406300

count=40 min_count=0 profile_info->sum_max=257406300

count=40 min_count=0 profile_info->sum_max=257406300

... ~60 similar lines with  min_count=0


  1   2   3   4   5   6   7   >