[Bug target/91276] Doc typos in __builtin_crypto_vpmsum*

2020-05-29 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91276

Lauri Kasanen  changed:

   What|Removed |Added

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

--- Comment #6 from Lauri Kasanen  ---
Yes, marking fixed.

[Bug target/91274] vec_splat_[us]64 missing for ppc

2020-01-21 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91274

--- Comment #3 from Lauri Kasanen  ---
Then why is every other type supported, but not 64? It makes no sense.

[Bug target/88696] New: Power VSX builtins missing vmuluwm / vector int vec_mul (vector int, vector int);

2019-01-04 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88696

Bug ID: 88696
   Summary: Power VSX builtins missing vmuluwm / vector int
vec_mul (vector int, vector int);
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---
Target: ppc64le

Seems gcc is currently missing the VSX built-in that multiplies int vectors.
The vmuluwm instruction seems otherwise supported by gcc codegen.

vector int vec_mul (vector int, vector int);
vector unsigned int vec_mul (vector unsigned int, vector unsigned int);

It was added in ISA 2.07 aka POWER8. Apologies if the "target" component is not
the right place for this.

[Bug target/88696] Power VSX builtins missing vmuluwm / vector int vec_mul (vector int, vector int);

2019-01-11 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88696

--- Comment #1 from Lauri Kasanen  ---
Actually, seems this is only a documentation bug. vec_mul for the int vectors
is not listed on any of the "PowerPC AltiVec/VSX Built-in Functions" pages,
even though it works. It emulates the multiplication on older ppc and on power8
correctly emits vmuluwm, since r224494.

[Bug lto/85609] New: lto_check_version should print file name when linking a static lib

2018-05-02 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85609

Bug ID: 85609
   Summary: lto_check_version should print file name when linking
a static lib
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

The current error message is not very helpful when linking against a static lib
instead of object files:
"lto1: fatal error: bytecode stream in file 'libwebkitfltk.a' generated with
LTO version 4.0 instead of the expected 6.0"

In this case, the lib has 3268 .o files. If the file is a lib, the error
message should include the .o file's filename too.

--
Is there any way to examine a file's LTO version? I tried dumping sections with
readelf, but nothing jumped at me.

[Bug target/91274] New: vec_splat_[us]64 missing for ppc

2019-07-27 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91274

Bug ID: 91274
   Summary: vec_splat_[us]64 missing for ppc
   Product: gcc
   Version: 8.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---
  Host: ppc64le
Target: ppc64le

The 64-bit vector splats for ppc are missing. They are there for s390, and
supported in the IBM compiler.

[Bug target/91275] New: __builtin_crypto_vpmsumd gives different results -O[123] vs -O0

2019-07-27 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91275

Bug ID: 91275
   Summary: __builtin_crypto_vpmsumd gives different results
-O[123] vs -O0
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---
  Host: ppc64le
Target: ppc64le

C:
#include 
#include 

int main() {

const unsigned long long r0l = 0x8e7dfceac070e3a0;
vector unsigned long long r0 = (vector unsigned long long) {r0l, 0}, v;
const vector unsigned long long pd = (vector unsigned long) {0xc2LLU <<
56, 0};

v = __builtin_crypto_vpmsumd((vector unsigned long long) {r0[0], 0},
pd);

printf("Got  %016lx %016lx\n", v[0], v[1]);
printf("Expected %016lx %016lx\n", 0x4000,
0x65bd7ab605a4a8ff);

return 0;
}

$ gcc -o bug bug.c && ./bug
Got  4000 65bd7ab605a4a8ff
Expected 4000 65bd7ab605a4a8ff

$ gcc -o bug bug.c -O1 && ./bug
Got  65bd7ab605a4a8ff 4000
Expected 4000 65bd7ab605a4a8ff

--

Note that I'm not sure which is wrong, -O0 or -O1-3, but certainly one of them
is.

[Bug other/91276] New: Doc typos in __builtin_crypto_vpmsum*

2019-07-27 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91276

Bug ID: 91276
   Summary: Doc typos in __builtin_crypto_vpmsum*
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---
  Host: ppc64le
Target: ppc64le

On the "PowerPC AltiVec Built-in Functions Available on ISA 3.0" page, there
are typos in the crypto vpmsum functions. All of them end in "b", when only the
char version should end in b. The u64 version should end in "d", and so on.
Code is correct, only the docs are wrong.

[Bug target/91275] __builtin_crypto_vpmsumd gives different results -O[123] vs -O0

2019-07-31 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91275

--- Comment #1 from Lauri Kasanen  ---
clang 7.0.0 outputs the expected values, aka the gcc -O0 ones, at all
optimization levels. (it calls the builtin __builtin_altivec_crypto_vpmsumd,
but no other changes)

[Bug target/91275] __builtin_crypto_vpmsumd gives different results -O[123] vs -O0

2019-09-30 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91275

--- Comment #7 from Lauri Kasanen  ---
Thanks for working on this. Per my experience, this is fast for gcc ;)

Are you sure about the smaller ones? To me they should not care about 64-bit
swaps, but clang lists them all as lane-sensitive:
https://llvm.org/doxygen/PPCVSXSwapRemoval_8cpp_source.html

Also, I'd like to ask if any other instructions added at the same time were
affected, just in case; the test suite did not catch this.

Will the patch be backported to stable branches? What would you recommend as a
workaround for existing gcc versions?

[Bug target/91275] __builtin_crypto_vpmsumd gives different results -O[123] vs -O0

2019-10-01 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91275

--- Comment #9 from Lauri Kasanen  ---
Can -mno-optimize-swaps be used per-function, in the code via some pragma?
Alternatively, does calling the instruction via inline asm prevent the
swapping?

[Bug target/91275] __builtin_crypto_vpmsumd gives different results -O[123] vs -O0

2019-10-01 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91275

--- Comment #14 from Lauri Kasanen  ---
Inline asm works on the buggy versions. Thanks.

[Bug target/82182] m68k slow code: u16/u8 division calls divsi3

2019-06-17 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82182

--- Comment #2 from Lauri Kasanen  ---
It may be a few weeks before I can test newer gcc.

[Bug target/82182] m68k slow code: u16/u8 division calls divsi3

2019-06-25 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82182

Lauri Kasanen  changed:

   What|Removed |Added

Version|7.2.0   |8.3.0
  Known to fail||7.2.0

--- Comment #3 from Lauri Kasanen  ---
8.3.0 produces the exact same slow code.

[Bug target/82182] New: m68k slow code: u16/u8 division calls divsi3

2017-09-11 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82182

Bug ID: 82182
   Summary: m68k slow code: u16/u8 division calls divsi3
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---

C:
#include 

uint16_t mydiv(const uint16_t a, const uint8_t b) {
return a / b;
}

uint16_t mydiv2(const uint16_t a, const uint16_t b) {
return a / b;
}


Assembly:
#NO_APP
.file   "kai.c"
.globl  __udivsi3
.globl  __divsi3
.text
.align  2
.globl  mydiv
.type   mydiv, @function
mydiv:
moveq #0,%d0
move.w 6(%sp),%d0
moveq #0,%d1
move.b 11(%sp),%d1
move.l %d1,-(%sp)
move.l %d0,-(%sp)
jsr __divsi3
addq.l #8,%sp
rts
.size   mydiv, .-mydiv
.align  2
.globl  mydiv2
.type   mydiv2, @function
mydiv2:
move.w 6(%sp),%d0
and.l #0x,%d0
divu.w 10(%sp),%d0
rts
.size   mydiv2, .-mydiv2
.ident  "GCC: (GNU) 7.2.0"


The hardware division is several times faster than divsi3. Further, I'm baffled
as to why gcc turns the unsigned division to signed, as udivsi3 would be faster
than divsi3.

[Bug tree-optimization/82750] New: Incorrect code for mednafen's array copy test with -O3

2017-10-27 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82750

Bug ID: 82750
   Summary: Incorrect code for mednafen's array copy test with -O3
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---

Mednafen's TestGCC81740 test fails with gcc 7.2 using -O3, but it works with
-O2 and -O3 -fno-tree-loop-vectorize. It also fails with gcc 5.2, but works
with gcc 4.8, so this is a regression somewhere between those two versions.

Source:
#include 
#include 

#define NO_CLONE __attribute__((noclone))
#define NO_INLINE __attribute__((noinline))

NO_INLINE NO_CLONE void TestGCC81740_Sub(int* p, unsigned count)
{
 static const int good[20] = { 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 10, 5, 6, 7, 8,
15, 10, 11, 12, 13 };

 assert(count == 20);

 for(unsigned i = 0; i < count; i++) {
 if (good[i] != p[i]) printf("got %u expected %u (%u)\n", p[i], good[i], i);
  assert(good[i] == p[i]);
  }
}

int TestGCC81740_b;

NO_INLINE NO_CLONE void TestGCC81740(void)
{
 int v[4][5] = { 0 };

 for(unsigned i = 0; i < sizeof(v) / sizeof(int); i++)
  (&v[0][0])[i] = i;

 for(int a = 3; a >= 0; a--)
  for(TestGCC81740_b = 0; TestGCC81740_b < 3; TestGCC81740_b++)
   v[TestGCC81740_b + 1][a + 1] = v[TestGCC81740_b][a];

 TestGCC81740_Sub(&v[0][0], sizeof(v) / sizeof(int));
}


int main() {
  TestGCC81740();
  return 0;
}

[Bug tree-optimization/82750] Incorrect code for mednafen's array copy test with -O3

2017-10-27 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82750

--- Comment #2 from Lauri Kasanen  ---
Thanks, passing to mednafen devs.

[Bug ipa/68419] New: ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2015-11-18 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

Bug ID: 68419
   Summary: ICE segfault in
determine_locally_known_aggregate_parts /
ipa_compute_jump_functions_for_edge
   Product: gcc
   Version: 5.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com
  Target Milestone: ---

Created attachment 36766
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36766&action=edit
Preprocessed source

Trying to build GCC 5.2 for m68k segfaults in bootstrap. Preprocessed source
attached.

Configure line:
../gcc-5.2.0/configure --prefix=/tmp/tmpgcc --target=m68k-elf
--enable-languages=c --disable-libssp --disable-tls --enable-threads=single

../../../../gcc-5.2.0/libgcc/unwind-dw2.c: In function 'uw_init_context_1':
../../../../gcc-5.2.0/libgcc/unwind-dw2.c:1695:0: internal compiler error:
Segmentation fault

Valgrind output:
==27154==
==27155== Memcheck, a memory error detector
==27155== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==27155== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==27155== Command: /tmp/gccbuild/./gcc/cc1 -quiet -I . -I . -I ../../.././gcc
-I ../../../../gcc-5.2.0/libgcc -I ../../../../gcc-5.2.0/libgcc/. -I
../../../../gcc-5.2.0/libgcc/../gcc -I ../../../../gcc-5.2.0/libgcc/../include
-imultilib m68000 -iprefix /tmp/gccbuild/gcc/../lib/gcc/m68k-elf/5.2.0/
-isystem /tmp/gccbuild/./gcc/include -isystem /tmp/gccbuild/./gcc/include-fixed
-MD unwind-dw2.d -MF unwind-dw2.dep -MP -MT unwind-dw2.o -D IN_GCC -D
CROSS_DIRECTORY_STRUCTURE -D IN_LIBGCC2 -D inhibit_libc -D HIDE_EXPORTS
-isystem /tmp/tmpgcc/m68k-elf/include -isystem /tmp/tmpgcc/m68k-elf/sys-include
-isystem ./include ../../../../gcc-5.2.0/libgcc/unwind-dw2.c -quiet -dumpbase
unwind-dw2.c -mcpu=68000 -auxbase-strip unwind-dw2.o -g -g -g -O2 -O2 -O2
-Wextra -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -fbuilding-libgcc
-fno-stack-protector -fexceptions -fvisibility=hidden -o /tmp/ccQM5a7W.s
==27155==
==27155== Conditional jump or move depends on uninitialised value(s)
==27155==at 0x7CF980: determine_locally_known_aggregate_parts(gcall*,
tree_node*, tree_node*, ipa_jump_func*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D3D1E: ipa_compute_jump_functions_for_edge(func_body_info*,
cgraph_edge*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D4B0C:
analysis_dom_walker::before_dom_children(basic_block_def*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0xC91083: dom_walker::walk(basic_block_def*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x7D93DD: ipa_analyze_node(cgraph_node*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0xCCF973: ipcp_generate_summary() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x8AE13E: execute_ipa_summary_passes(ipa_opt_pass_d*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x5EDFFF: symbol_table::compile() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x5EF15C: symbol_table::finalize_compilation_unit() (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x4CF6B6: c_write_global_declarations() (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x97DB6B: compile_file() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x97EBDF: do_compile() (in /tmp/gccbuild/gcc/cc1)
==27155==
==27155== Use of uninitialised value of size 8
==27155==at 0x7CF982: determine_locally_known_aggregate_parts(gcall*,
tree_node*, tree_node*, ipa_jump_func*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D3D1E: ipa_compute_jump_functions_for_edge(func_body_info*,
cgraph_edge*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D4B0C:
analysis_dom_walker::before_dom_children(basic_block_def*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0xC91083: dom_walker::walk(basic_block_def*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x7D93DD: ipa_analyze_node(cgraph_node*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0xCCF973: ipcp_generate_summary() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x8AE13E: execute_ipa_summary_passes(ipa_opt_pass_d*) (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x5EDFFF: symbol_table::compile() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x5EF15C: symbol_table::finalize_compilation_unit() (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x4CF6B6: c_write_global_declarations() (in
/tmp/gccbuild/gcc/cc1)
==27155==by 0x97DB6B: compile_file() (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x97EBDF: do_compile() (in /tmp/gccbuild/gcc/cc1)
==27155==
==27155== Use of uninitialised value of size 8
==27155==at 0x7CF991: determine_locally_known_aggregate_parts(gcall*,
tree_node*, tree_node*, ipa_jump_func*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D3D1E: ipa_compute_jump_functions_for_edge(func_body_info*,
cgraph_edge*) (in /tmp/gccbuild/gcc/cc1)
==27155==by 0x7D4B0C:
analysis_dom_walker::before_dom_children(basic_block_def*) (in
/tmp/gcc

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2015-11-18 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #1 from Lauri Kasanen  ---
This is very similar to 64551, but not a dup. Another part of IPA failing.

[Bug c++/61721] New: GCC 4.8-4.10 miscompiles webkit hashing

2014-07-05 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

Bug ID: 61721
   Summary: GCC 4.8-4.10 miscompiles webkit hashing
   Product: gcc
   Version: 4.10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com

GCC 4.8.3 and 4.10 trunk@212302 tested, both broken. According to
https://bugreports.qt-project.org/browse/QTBUG-31988 this is a regression and
worked in 4.7, but I cannot confirm that as 4.7 can't build current webkit.

Building webkit with current GCC and -O2 or above miscompiles the
hashmap/hashtable hashMemory function and perhaps other parts, causing crashes
in multiple places. -O1 works fine, as does adding -fno-inline or
-fno-strict-aliasing to -O2 or -O3.

The affected files produce no warnings with -Wall -Wextra. Attaching
preprocessed source from both failing (-O2) and working (-O2 -fno-inline)
cases.

Valgrind output from the failing case:

==5710== Use of uninitialised value of size 8
==5710==at 0x15395A6: void
std::swap(WebCore::StorageAreaImpl*&,
WebCore::StorageAreaImpl*&) (move.h:175)
==5710==by 0x153965A:
WTF::RefPtr::operator=(WTF::RefPtr
const&) (RefPtr.h:109)
==5710==by 0x153BC32:
WTF::HashTableAddResult,
WTF::KeyValuePair,
WTF::RefPtr >,
WTF::KeyValuePairKeyExtractor,
WTF::RefPtr > >, WebCore::SecurityOriginHash,
WTF::KeyValuePairHashTraits
>, WTF::HashTraits > >,
WTF::HashTraits > > >
WTF::HashTable,
WTF::KeyValuePair,
WTF::RefPtr >,
WTF::KeyValuePairKeyExtractor,
WTF::RefPtr > >, WebCore::SecurityOriginHash,
WTF::KeyValuePairHashTraits
>, WTF::HashTraits > >,
WTF::HashTraits >
>::add
>, WTF::HashTraits > >,
WebCore::SecurityOriginHash>, WTF::RefPtr const&,
WTF::RefPtr&>(WTF::RefPtr
const&, WTF::RefPtr&) (HashTable.h:858)
==5710==by 0x153BD19:
WTF::HashTableAddResult,
WTF::KeyValuePair,
WTF::RefPtr >,
WTF::KeyValuePairKeyExtractor,
WTF::RefPtr > >, WebCore::SecurityOriginHash,
WTF::KeyValuePairHashTraits
>, WTF::HashTraits > >,
WTF::HashTraits > > >
WTF::HashMap,
WTF::RefPtr, WebCore::SecurityOriginHash,
WTF::HashTraits >,
WTF::HashTraits >
>::inlineAdd&>(WTF::RefPtr
const&, WTF::RefPtr&) (RefPtrHashMap.h:207)
==5710==by 0x153BD50:
WTF::HashTableAddResult,
WTF::KeyValuePair,
WTF::RefPtr >,
WTF::KeyValuePairKeyExtractor,
WTF::RefPtr > >, WebCore::SecurityOriginHash,
WTF::KeyValuePairHashTraits
>, WTF::HashTraits > >,
WTF::HashTraits > > >
WTF::HashMap,
WTF::RefPtr, WebCore::SecurityOriginHash,
WTF::HashTraits >,
WTF::HashTraits >
>::set&>(WTF::RefPtr
const&, WTF::RefPtr&) (RefPtrHashMap.h:221)
==5710==by 0x153BE7F:
WebCore::StorageNamespaceImpl::storageArea(WTF::PassRefPtr)
(StorageNamespaceImpl.cpp:134)
==5710==by 0x51DFB1: WebCore::DOMWindow::sessionStorage(int&) const (in
testapp)
==5710==by 0x12F60A1: WebCore::jsDOMWindowSessionStorage(JSC::ExecState*,
JSC::JSObject*, long, JSC::PropertyName) (in testapp)
==5710==by 0xD54049: JSC::JSValue::get(JSC::ExecState*, JSC::PropertyName,
JSC::PropertySlot&) const (in testapp)
==5710==by 0x1B79FE3: llint_slow_path_get_by_id (in testapp)
==5710==by 0x1B7240A: ??? (in testapp)
==5710==by 0x1B75747: ??? (in testapp)
==5710==  Uninitialised value was created by a stack allocation
==5710==at 0x1539270:
WebCore::SecurityOriginHash::hash(WTF::RefPtr const&)
(SecurityOriginHash.h:50)

The code from SecurityOriginHash:
static unsigned hash(SecurityOrigin* origin)
{
unsigned hashCodes[3] = {
origin->protocol().impl() ? origin->protocol().impl()->hash() : 0,
origin->host().impl() ? origin->host().impl()->hash() : 0,
origin->port()
};
return StringHasher::hashMemory(hashCodes);
}

There is no way hashCodes[] could be uninitialized. This issue does not
manifest on VS and clang, but it could still be some bug in webkit too.


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-07-05 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

--- Comment #1 from Lauri Kasanen  ---
Created attachment 33073
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33073&action=edit
Failing preprocessed source from 4.10-git


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-07-05 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

--- Comment #2 from Lauri Kasanen  ---
Created attachment 33074
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33074&action=edit
Working case from 4.10-git (-fno-inline)


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-07-05 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

--- Comment #3 from Lauri Kasanen  ---
$ g++ -v
Using built-in specs.
COLLECT_GCC=/tmp/install/bin/g++
COLLECT_LTO_WRAPPER=/tmp/install/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/tmp/install --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --with-system-zlib --enable-languages=c,c++
--disable-bootstrap
Thread model: posix
gcc version 4.10.0 20140705 (experimental) (GCC)

Full build command used:
/tmp/install/bin/g++ -c -o storage/StorageNamespaceImpl.o -march=nocona -pipe
-fomit-frame-pointer -I .. -I . -I ../WTF -std=gnu++11 -DBUILDING_FLTK__
-D_GLIBCXX_USE_SCHED_YIELD -D_GLIBCXX_USE_NANOSLEEP -I/opt/icu/include 
-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
-I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libxml2
-I/usr/include/harfbuzz -I/usr/X11R7/include/pixman-1 -I/usr/X11R7/include  
-I/opt/fltk13/include -I/usr/include/freetype2 -march=nocona -pipe
-fomit-frame-pointer -fno-rtti -fno-exceptions -I/usr/X11R7/include
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -I
Modules/battery -I Modules/encryptedmedia -I Modules/gamepad -I
Modules/geolocation -I Modules/indexeddb -I Modules/indexeddb/leveldb -I
Modules/indieui -I Modules/mediacontrols/ -I Modules/mediasource -I
Modules/mediastream -I Modules/navigatorcontentutils -I Modules/notifications
-I Modules/plugins -I Modules/proximity -I Modules/quota -I Modules/vibration
-I Modules/webaudio -I Modules/webdatabase -I Modules/websockets -I
accessibility -I bindings -I bindings/generic -I bindings/js -I bridge -I
bridge/c -I bridge/jsc -I crypto -I crypto/keys -I css -I cssjit -I dom -I
dom/default -I editing -I fileapi -I history -I html -I html/canvas -I
html/forms -I html/parser -I html/shadow -I html/track -I inspector -I loader
-I loader/appcache -I loader/archive -I loader/archive/mhtml -I loader/cache -I
loader/icon -I mathml -I page -I page/animation -I page/scrolling -I platform
-I platform/animation -I platform/audio -I platform/graphics -I
platform/graphics/cpu/arm -I platform/graphics/cpu/arm/filters -I
platform/graphics/filters -I platform/graphics/filters/texmap -I
platform/graphics/harfbuzz -I platform/graphics/harfbuzz/ng -I
platform/graphics/opentype -I platform/graphics/texmap -I
platform/graphics/transforms -I platform/image-decoders -I
platform/image-decoders/bmp -I platform/image-decoders/gif -I
platform/image-decoders/ico -I platform/image-decoders/jpeg -I
platform/image-decoders/png -I platform/image-decoders/webp -I platform/leveldb
-I platform/mediastream -I platform/mock -I platform/network -I platform/sql -I
platform/text -I platform/text/icu -I plugins -I rendering -I rendering/line -I
rendering/mathml -I rendering/shapes -I rendering/style -I rendering/svg -I
replay -I storage -I style -I svg -I svg/animation -I svg/graphics -I
svg/graphics/filters -I svg/properties -I websockets -I workers -I xml -I
xml/parser -I ../JavaScriptCore -I ../JavaScriptCore/ForwardingHeaders -I
../JavaScriptCore/API -I ../JavaScriptCore/assembler -I
../JavaScriptCore/bytecode -I ../JavaScriptCore/bytecompiler -I
../JavaScriptCore/dfg -I ../JavaScriptCore/disassembler -I
../JavaScriptCore/heap -I ../JavaScriptCore/debugger -I
../JavaScriptCore/interpreter -I ../JavaScriptCore/jit -I
../JavaScriptCore/llint -I ../JavaScriptCore/parser -I
../JavaScriptCore/profiler -I ../JavaScriptCore/runtime -I
../JavaScriptCore/yarr -I ForwardingHeaders -I platform/cairo -I
platform/graphics/cairo -I platform/graphics/freetype -I platform/linux -I
platform/network/curl -I platform/text/icu  -DENABLE_CANVAS_PATH 
-DENABLE_CHANNEL_MESSAGING  -DENABLE_CONTEXT_MENUS 
-DENABLE_CSS_BOX_DECORATION_BREAK 
-DENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED  -DENABLE_DETAILS_ELEMENT 
-DENABLE_FTPDIR  -DENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING 
-DENABLE_ICONDATABASE  -DENABLE_IMAGE_DECODER_DOWN_SAMPLING  -DENABLE_INSPECTOR
 -DENABLE_JIT  -DENABLE_LEGACY_VENDOR_PREFIXES  -DENABLE_LINK_PREFETCH 
-DENABLE_LLINT  -DENABLE_METER_ELEMENT  -DENABLE_NAVIGATOR_HWCONCURRENCY 
-DENABLE_PROMISES  -DENABLE_PROGRESS_ELEMENT  -DENABLE_SVG_FONTS 
-DENABLE_TEMPLATE_ELEMENT  -DENABLE_WEB_SOCKETS  -DENABLE_XSLT 
-DENABLE_SUBPIXEL_LAYOUT  -DENABLE_VIEW_MODE_CSS_MEDIA  -DENABLE_CURSOR_SUPPORT
 -DENABLE_DRAG_SUPPORT  -DENABLE_MATHML  -DENABLE_TEXT_CARET 
-DENABLE_TEXT_SELECTION  -DENABLE_WILL_REVEAL_EDGE_EVENTS 
-DWTF_USE_TEXTURE_MAPPER  -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS
-DENABLE_NETSCAPE_PLUGIN_API=0 -DENABLE_SQL_DATABASE=0
-DENABLE_DATE_AND_TIME_INPUT_TYPES=0 -ffunction-sections -fdata-sections
-fno-rtti -fno-exceptions storage/StorageNamespaceImpl.cpp -g -save-temps -O2


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-07-05 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

--- Comment #5 from Lauri Kasanen  ---
A -fsanitize=undefined built binary does not print anything. I understand it
can't catch all undefined behavior?

What is more interesting that adding -fsanitize=undefined to a failing case
makes it work, changing nothing else. So it too affects the optimizer somehow.


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-08-17 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

Lauri Kasanen  changed:

   What|Removed |Added

  Known to fail|4.10.0  |5.0

--- Comment #7 from Lauri Kasanen  ---
Latest trunk (214073) is still broken.

Using latest trunk, I tried all optimization sub-options in
O2 to find the smallest hammer that fixes it.

-O2 -fno-thread-jumps: crash
-O2 -fno-align-functions: crash
...
-O2 -fno-use-caller-save: crash

The only combos that worked:

-O2 -fno-inline-small-functions: works
-O2 -fno-strict-aliasing: works

Moving to -O1 with those:

-O1 -finline-small-functions: works
-O1 -fstrict-aliasing: works
-O1 -fstrict-aliasing -finline-small-functions: crash


This does point to the code being wrong somehow, but in that case,
-Wall -Wextra should say something, and this would be a missing warning
bug in gcc.


[Bug c++/61721] GCC 4.8-4.10 miscompiles webkit hashing

2014-08-18 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61721

Lauri Kasanen  changed:

   What|Removed |Added

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

--- Comment #8 from Lauri Kasanen  ---
Found this is a duplicate, and yes, it is a webkit bug.

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


[Bug middle-end/60546] [4.8/4.9] O2 & asan enable generates wrong insns

2014-08-18 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60546

Lauri Kasanen  changed:

   What|Removed |Added

 CC||cand at gmx dot com

--- Comment #23 from Lauri Kasanen  ---
*** Bug 61721 has been marked as a duplicate of this bug. ***


[Bug c++/62266] New: Loop unrolling with template metaprogramming not aggressive enough

2014-08-26 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62266

Bug ID: 62266
   Summary: Loop unrolling with template metaprogramming not
aggressive enough
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: cand at gmx dot com

The following code fails to compile with all GCC versions I have, up to g++
(GCC) 5.0.0 20140817 (experimental). It also fails with clang, but it would be
nice for this to work, as it would save some writing.

The index i is in constant bounds, and so the compiler should be able to fully
unroll this loop into "foo<0>(); foo<1>(); foo<2>();".

#include 

template  void foo() {
printf("%u\n", T);
}

int main() {

int i;
for (i = 0; i < 3; i++) {
foo();
}

return 0;
}


[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2015-12-16 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #3 from Lauri Kasanen  ---
The exact arguments are included in my post? Both the gcc configure like that
created them, and the direct args used.

Do you mean 5.3 or git?

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2015-12-17 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

Lauri Kasanen  changed:

   What|Removed |Added

Version|5.2.0   |5.3.0

--- Comment #4 from Lauri Kasanen  ---
5.3 is still broken. Same file, same error, though 5.3 printed a new backtrace
by itself.

/tmp/gcc-build/./gcc/xgcc -B/tmp/gcc-build/./gcc/ -B/tmp/tmpgcc/m68k-elf/bin/
-B/tmp/tmpgcc/m68k-elf/lib/ -isystem /tmp/tmpgcc/m68k-elf/include -isystem
/tmp/tmpgcc/m68k-elf/sys-include-g -O2 -mcpu=68000 -O2  -g -O2 -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
-Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../gcc-5.3.0/libgcc
-I../../../../gcc-5.3.0/libgcc/. -I../../../../gcc-5.3.0/libgcc/../gcc
-I../../../../gcc-5.3.0/libgcc/../include-o unwind-dw2.o -MT unwind-dw2.o
-MD -MP -MF unwind-dw2.dep -fexceptions -c
../../../../gcc-5.3.0/libgcc/unwind-dw2.c -fvisibility=hidden -DHIDE_EXPORTS
../../../../gcc-5.3.0/libgcc/unwind-dw2.c: In function
'_Unwind_RaiseException':
../../../../gcc-5.3.0/libgcc/unwind-dw2.c:1695:0: internal compiler error:
Segmentation fault

 ^
0x8d19ef crash_signal
../../gcc-5.3.0/gcc/toplev.c:383
0x7787c2 get_place_in_agg_contents_list
../../gcc-5.3.0/gcc/ipa-prop.c:1400
0x7787c2 determine_locally_known_aggregate_parts
../../gcc-5.3.0/gcc/ipa-prop.c:1571
0x780a60 ipa_compute_jump_functions_for_edge
../../gcc-5.3.0/gcc/ipa-prop.c:1757
0x78130c ipa_compute_jump_functions_for_bb
../../gcc-5.3.0/gcc/ipa-prop.c:1785
0x78130c analysis_dom_walker::before_dom_children(basic_block_def*)
../../gcc-5.3.0/gcc/ipa-prop.c:2299
0xb8f394 dom_walker::walk(basic_block_def*)
../../gcc-5.3.0/gcc/domwalk.c:188
0x78020f ipa_analyze_node(cgraph_node*)
../../gcc-5.3.0/gcc/ipa-prop.c:2355
0xbc28e3 ipcp_generate_summary
../../gcc-5.3.0/gcc/ipa-cp.c:4521
0x8315ce execute_ipa_summary_passes(ipa_opt_pass_d*)
../../gcc-5.3.0/gcc/passes.c:2156
0x5eb6df ipa_passes
../../gcc-5.3.0/gcc/cgraphunit.c:2196
0x5eb6df symbol_table::compile()
../../gcc-5.3.0/gcc/cgraphunit.c:2312
0x5ec68c symbol_table::finalize_compilation_unit()
../../gcc-5.3.0/gcc/cgraphunit.c:2461
0x4f63b2 c_write_global_declarations()
../../gcc-5.3.0/gcc/c/c-decl.c:10799

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2016-01-08 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #6 from Lauri Kasanen  ---
Here's more details on my system.

Host gcc: 4.2.2
Host binutils: 2.25.1
m68k binutils: 2.24

I used make -j13, but a parallel build shouldn't affect things. I doubt the
host gcc version is at fault either, given the function was passed NULL. I can
try the latest 5 branch later on if you think it'd be useful?

I have no ccache or other complications like that.

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2016-01-14 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #8 from Lauri Kasanen  ---
Today's gcc 5 branch, git 4e07f8a1b79f5e or svn r232358, still fails.

/tmp/gccbuild/./gcc/xgcc -B/tmp/gccbuild/./gcc/ -B/tmp/tmpgcc/m68k-elf/bin/
-B/tmp/tmpgcc/m68k-elf/lib/ -isystem /tmp/tmpgcc/m68k-elf/include -isystem
/tmp/tmpgcc/m68k-elf/sys-include-g -O2 -mcpu=68000 -O2  -g -O2 -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector
-Dinhibit_libc  -I. -I. -I../../.././gcc -I../../../../gcc-git/libgcc
-I../../../../gcc-git/libgcc/. -I../../../../gcc-git/libgcc/../gcc
-I../../../../gcc-git/libgcc/../include-o unwind-dw2.o -MT unwind-dw2.o -MD
-MP -MF unwind-dw2.dep -fexceptions -c ../../../../gcc-git/libgcc/unwind-dw2.c
-fvisibility=hidden -DHIDE_EXPORTS
../../../../gcc-git/libgcc/unwind-dw2.c: In function '_Unwind_RaiseException':
../../../../gcc-git/libgcc/unwind-dw2.c:1695:0: internal compiler error:
Segmentation fault

 ^
0x8d1d1f crash_signal
../../gcc-git/gcc/toplev.c:383
0x778ad2 get_place_in_agg_contents_list
../../gcc-git/gcc/ipa-prop.c:1400
0x778ad2 determine_locally_known_aggregate_parts
../../gcc-git/gcc/ipa-prop.c:1571
0x780d70 ipa_compute_jump_functions_for_edge
../../gcc-git/gcc/ipa-prop.c:1757
0x78161c ipa_compute_jump_functions_for_bb
../../gcc-git/gcc/ipa-prop.c:1785
0x78161c analysis_dom_walker::before_dom_children(basic_block_def*)
../../gcc-git/gcc/ipa-prop.c:2299
0xb8f804 dom_walker::walk(basic_block_def*)
../../gcc-git/gcc/domwalk.c:188
0x78051f ipa_analyze_node(cgraph_node*)
../../gcc-git/gcc/ipa-prop.c:2355
0xbc2d73 ipcp_generate_summary
../../gcc-git/gcc/ipa-cp.c:4534
0x8318ae execute_ipa_summary_passes(ipa_opt_pass_d*)
../../gcc-git/gcc/passes.c:2156
0x5eb98f ipa_passes
../../gcc-git/gcc/cgraphunit.c:2197
0x5eb98f symbol_table::compile()
../../gcc-git/gcc/cgraphunit.c:2313
0x5ec93c symbol_table::finalize_compilation_unit()
../../gcc-git/gcc/cgraphunit.c:2462
0x4f63c2 c_write_global_declarations()
../../gcc-git/gcc/c/c-decl.c:10822
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2016-01-14 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #9 from Lauri Kasanen  ---
Your command line from comment #5 fails similarly, on my original attachment.

./gcc/cc1 -O2 unwind-dw2.i -g -auxbase-strip unwind-dw2.o -g -O2
-fbuilding-libgcc -fno-stack-protector -fexceptions -fvisibility=hidden -quiet
../../../../gcc-5.2.0/libgcc/unwind-dw2.c: In function
'_Unwind_RaiseException':
../../../../gcc-5.2.0/libgcc/unwind-dw2.c:1695:0: internal compiler error:
Segmentation fault
0x8d1d1f crash_signal
../../gcc-git/gcc/toplev.c:383
0x778ad2 get_place_in_agg_contents_list
../../gcc-git/gcc/ipa-prop.c:1400
0x778ad2 determine_locally_known_aggregate_parts
../../gcc-git/gcc/ipa-prop.c:1571
0x780d70 ipa_compute_jump_functions_for_edge
../../gcc-git/gcc/ipa-prop.c:1757
0x78161c ipa_compute_jump_functions_for_bb
../../gcc-git/gcc/ipa-prop.c:1785
0x78161c analysis_dom_walker::before_dom_children(basic_block_def*)
../../gcc-git/gcc/ipa-prop.c:2299
0xb8f804 dom_walker::walk(basic_block_def*)
../../gcc-git/gcc/domwalk.c:188
0x78051f ipa_analyze_node(cgraph_node*)
../../gcc-git/gcc/ipa-prop.c:2355
0xbc2d73 ipcp_generate_summary
../../gcc-git/gcc/ipa-cp.c:4534
0x8318ae execute_ipa_summary_passes(ipa_opt_pass_d*)
../../gcc-git/gcc/passes.c:2156
0x5eb98f ipa_passes
../../gcc-git/gcc/cgraphunit.c:2197
0x5eb98f symbol_table::compile()
../../gcc-git/gcc/cgraphunit.c:2313
0x5ec93c symbol_table::finalize_compilation_unit()
../../gcc-git/gcc/cgraphunit.c:2462
0x4f63c2 c_write_global_declarations()
../../gcc-git/gcc/c/c-decl.c:10822
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2016-01-14 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #10 from Lauri Kasanen  ---
When using gcc 5.2 as the host compiler, there is no crash.

The gcc docs state that any version of gcc above 3.4 is supported, so this is
still a bug.

[Bug ipa/68419] ICE segfault in determine_locally_known_aggregate_parts / ipa_compute_jump_functions_for_edge

2016-01-14 Thread cand at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68419

--- Comment #12 from Lauri Kasanen  ---
https://gcc.gnu.org/install/prerequisites.html

"To build all languages in a cross-compiler or other configuration where
3-stage bootstrap is not performed, you need to start with an existing GCC
binary (version 3.4 or later) because source code for language frontends other
than C might use GCC extensions."

Version 3.4 or later.