[Bug tree-optimization/53947] [meta-bug] vectorizer missed-optimizations

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
Bug 53947 depends on bug 67326, which changed state.

Bug 67326 Summary: [6 Regression] -ftree-loop-if-convert-stores does not 
vectorize conditional assignment (anymore)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67326

   What|Removed |Added

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

[Bug tree-optimization/67326] [6 Regression] -ftree-loop-if-convert-stores does not vectorize conditional assignment (anymore)

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67326

Eric Gallager  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|6.5 |7.0

--- Comment #9 from Eric Gallager  ---
(In reply to Richard Biener from comment #7)
> Unlikely to be backported (depends on too many refactorings IIRC).

ok, closing then so other backports can be focused on before the gcc-6 branch
closes, too

[Bug rtl-optimization/77770] [6 Regression] Internal compiler error on source which compiles with earlier versions.

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=0

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=80017,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=70478

--- Comment #10 from Eric Gallager  ---
(In reply to Markus Trippelsdorf from comment #3)
> markus@x4 gcc % cat print_flt32.i
> extern void fn2(int, int);
> int a;
> void fn1(float p1) {
>   __asm__("" : "=r"(a) : "0"(p1));
>   fn2(0, a);
> }
> 
> markus@x4 gcc % ./cc1 -mthumb -fpreprocessed print_flt32.i -quiet -Os -o
> /dev/null
> 
> print_flt32.i: In function ‘fn1’:
> print_flt32.i:6:1: internal compiler error: Max. number of generated reload
> insns per insn is achieved (90)

That's the same error message as in bug 80017.

(also why is this bug still ASSIGNED when there's no assignee?)

[Bug rtl-optimization/87596] [9 Regression] ICE: Segmentation fault (in spill_hard_reg_in_range)

2018-10-12 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87596

Arseny Solokha  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=87485

--- Comment #5 from Arseny Solokha  ---
I'd mark PR87485 as related, then.

[Bug tree-optimization/71016] [6 Regression] Redundant sign extension with conditional __builtin_clzl

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71016

Eric Gallager  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|6.5 |7.0

--- Comment #14 from Eric Gallager  ---
(In reply to Ramana Radhakrishnan from comment #13)
> (In reply to Richard Biener from comment #12)
> > GCC 6.4 is being released, adjusting target milestone.
> 
> Should we just close this one as wont backport and fix it at GCC-7 ?

Sure.

[Bug tree-optimization/71691] [6 Regression] wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu (Floating point exception)

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71691

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #24 from Eric Gallager  ---
(In reply to Aldy Hernandez from comment #22)
> Fixed in trunk.  Removing GCC7 regression marker.

Are you still planning to backport to gcc-6?

[Bug c++/87603] [C++17] noexcept isn't special cased for constant expressions anymore

2018-10-12 Thread miguel.ojeda.sandonis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87603

Miguel Ojeda  changed:

   What|Removed |Added

  Attachment #44832|0   |1
is obsolete||

--- Comment #2 from Miguel Ojeda  ---
Created attachment 44833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44833=edit
patch + test

Changed PR number in testcase comment to the assigned one

[Bug c++/87603] [C++17] noexcept isn't special cased for constant expressions anymore

2018-10-12 Thread miguel.ojeda.sandonis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87603

--- Comment #1 from Miguel Ojeda  ---
Created attachment 44832
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44832=edit
patch + test

[Bug c++/87603] New: [C++17] noexcept isn't special cased for constant expressions anymore

2018-10-12 Thread miguel.ojeda.sandonis at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87603

Bug ID: 87603
   Summary: [C++17] noexcept isn't special cased for constant
expressions anymore
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: miguel.ojeda.sandonis at gmail dot com
  Target Milestone: ---

CWG 1129 (which ended up in C++11) added a special case to noexcept for
constant expressions, so that:

constexpr void f() {} static_assert(noexcept(f()));

CWG 1351 (which ended up in C++14) changed the wording significantly, but the
special case remained, in a different form.

P0003R5 (which ended up in C++17) changed the wording again, but the special
case was removed (by accident), so now:

constexpr void f() {} static_assert(!noexcept(f()));

According to Richard Smith in LLVM 15481, CWG discussed this but decided to
keep the behavior as-is. Currently, clang does the right thing for C++17 (and
fails for C++14 and C++11, on purpose). g++, however, implemented the special
case for C++11 already, but not the change for C++17. Currently, icc and msvc
seem to behave like g++.

[Bug rtl-optimization/70703] [6 regression] Regression in register usage on x86

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70703

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #17 from Eric Gallager  ---
(In reply to Jakub Jelinek from comment #14)
> Fixed on the trunk, not sure about backports if it is desirable or not.
> Thanks Vlad!

Well now's the last chance for backports; if the "not sure" is a "let's not
bother" then time to close this I guess, but if the "not sure" is "maybe
there's still a chance" then let's leave it open for now.

[Bug target/71321] [6 Regression] x86: worse code for uint8_t % 10 and / 10

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71321

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #9 from Eric Gallager  ---
(In reply to Bernd Schmidt from comment #6)
> Author: bernds
> Date: Wed Dec 21 16:45:33 2016
> New Revision: 243861
> 
> URL: https://gcc.gnu.org/viewcvs?rev=243861=gcc=rev
> Log:
> 
>   PR target/71321
>   * config/i386/i386.md (lea_general_2b, lea_general_3b): New
>   patterns.
>   * config/i386/predicates.md (const123_operand): New.
> 
>   PR target/71321
>   * gcc.target/i386/pr71321.c: New test.
> 
> 
> Added:
> trunk/gcc/testsuite/gcc.target/i386/pr71321.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/config/i386/i386.md
> trunk/gcc/config/i386/predicates.md
> trunk/gcc/testsuite/ChangeLog

Are you still working on a backport for this, Bernd?

[Bug middle-end/79212] [6 Regression] internal compiler error: in maybe_lookup_decl_in_outer_ctx, at omp-low.c:4134

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79212

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #9 from Eric Gallager  ---
(In reply to davids from comment #5)
> (In reply to Jakub Jelinek from comment #4)
> > Started with r233913, I'll have a look.
> 
> Hi Jakub, just to let you know I posted a possible fix for 7.0 release on
> the mailing list yesterday if you want to have a look.

Are you still working on a backport for the 6 branch?

[Bug ipa/78027] [6 Regression] ICE in new_oacc_loop_routine, at omp-low.c:19000

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78027

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #9 from Eric Gallager  ---
(In reply to cesar from comment #7)
> Last I heard in 
> Jakub was going to look for a better solution. My patch is still in trunk,
> but if necessary I could always revert it.

Jakub have you found a better solution yet?

[Bug rtl-optimization/87596] [9 Regression] ICE: Segmentation fault (in spill_hard_reg_in_range)

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87596

Peter Bergner  changed:

   What|Removed |Added

 CC||iii at linux dot ibm.com

--- Comment #4 from Peter Bergner  ---
Well, Andreas seems to have committed it for Ilya, so CCing him too.

[Bug rtl-optimization/87596] [9 Regression] ICE: Segmentation fault (in spill_hard_reg_in_range)

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87596

Peter Bergner  changed:

   What|Removed |Added

 CC||krebbel at gcc dot gnu.org

--- Comment #3 from Peter Bergner  ---
My bisect found that Andreas is the unlucky winner of this bug:

r263063 | krebbel | 2018-07-30 03:30:06 -0500 (Mon, 30 Jul 2018) | 18 lines

lra: consider clobbers when selecting hard_regno to spill

The idea behind the rclass loop in spill_hard_reg_in_range() seems to
be: find a hard_regno, which in general conflicts with reload regno,
but does not do so between `from` and `to`, and then do the live range
splitting based on this information. To check the absence of conflicts,
we make use of insn_bitmap, which does not contain insns which clobber
the hard_regno.

gcc/ChangeLog:

2018-07-30  Ilya Leoshkevich  

PR target/86547
* lra-constraints.c (spill_hard_reg_in_range): When selecting the
hard_regno, make sure no insn between `from` and `to` clobbers it.

[Bug c++/86208] [6/7 Regression] improper handling of an extern declared inline function

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86208

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #10 from Jakub Jelinek  ---
Fixed also for 6.5 and 7.4+.

[Bug middle-end/86539] OpenMP wrong-code with taskloop and references

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86539

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #6 from Jakub Jelinek  ---
Fixed for 6.5, 7.4+ and 8.3+.

[Bug fortran/86421] OpenMP declare simd linear ref in module causes gfortran to bail out

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86421

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #7 from Jakub Jelinek  ---
Fixed for 6.5, 7.4+ and 8.3+.

[Bug middle-end/86627] [6/7 Regression] Signed 128-bit division by 2 no longer expanded to RTL

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86627

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #13 from Jakub Jelinek  ---
Fixed for 6.5, 7.4+ and 8.3+.

[Bug rtl-optimization/87065] [7 Regression] combine causes ICE in trunc_int_for_mode

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87065

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #14 from Jakub Jelinek  ---
Fixed.

[Bug target/87550] Intrinsics for rdpmc (__rdpmc, __builtin_ia32_rdpmc) are interpreted as pure functions

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87550

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #9 from Jakub Jelinek  ---
Fixed for 6.5, 7.4+ and 8.3+.

[Bug middle-end/87248] [6/7 Regression] Bad code for masked operations involving signed ints

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87248

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #8 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/86542] wrong-code for collapsed taskloop which needs omp_cpyfn

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86542

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #5 from Jakub Jelinek  ---
Fixed.

[Bug fortran/58786] module function with passed character array of explicit length causes an ICE

2018-10-12 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58786

--- Comment #3 from Dominique d'Humieres  ---
> Tobias, after your fix as of today on PR58787, is that original issue also 
> fixed?

AFAICT no:

../../work/gcc/tree.h:3231:28: runtime error: member access within null pointer
of type 'union tree_node'
pr58786.f90:20:0:

20 |PRINT *, array_to_string(['',''])
   | 
internal compiler error: Segmentation fault: 11

[Bug fortran/58786] module function with passed character array of explicit length causes an ICE

2018-10-12 Thread juergen.reuter at desy dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58786

--- Comment #2 from Jürgen Reuter  ---
Tobias, after your fix as of today on PR58787, is that original issue also
fixed?

[Bug rtl-optimization/87596] [9 Regression] ICE: Segmentation fault (in spill_hard_reg_in_range)

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87596

Peter Bergner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-10-12
 Ever confirmed|0   |1

--- Comment #2 from Peter Bergner  ---
ICE is confirmed, but it's not my fault.  I see the ICE with revision 264725
which is before any of my recent patches.  I'll continue bisecting to see if I
can pinpoint the bad revision though.

[Bug fortran/87566] ICE with class(*) and select

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87566

--- Comment #3 from Tobias Burnus  ---
@Paul: Some guidance is welcome!

(In reply to Tobias Burnus from comment #2)
> For some odd reasons the gimplfier does not like that f951 assigns a value
> to the digit 0 (last but one line of the "finally") ...

That's in trans-expr.c's gfc_conv_class_to_class():

  if (UNLIMITED_POLY (e))
tmp = gfc_class_len_get (tmp);
  else if (e->ts.type == BT_CHARACTER)
  tmp = slen;
  else
tmp = build_zero_cst (size_type_node);
  gfc_add_modify (>pre, ctree,
  fold_convert (TREE_TYPE (ctree), tmp));

OK so far – now comes the finally part:

  if (!elemental && full_array && copyback)
  gfc_add_modify (>post, tmp,
  fold_convert (TREE_TYPE (tmp), ctree));

And here we have assigned (if the "else" branch for tmp branch was taken) a
value to the build_zero_cst()!


Actually, I wonder whether the _len = 0 is needed. The current code is:

class.0._len = 0;
class.0._data =
__tmp_class_object_array_pointer->_data->p._data;
class.0._vptr =
__tmp_class_object_array_pointer->_data->p._vptr;
class.0._len = __tmp_class_object_array_pointer->_data->p._len;

i.e. we set _len twice. And also in finally, we have it also twice:

 0 = (unsigned long) class.0._len;
 __tmp_class_object_array_pointer->_data->p._len = class.0._len;

As band-aid the following works (on top of the patch from attachment 44831)

--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1133,3 +1133,3 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e,
gfc_typespec class_ts,
references, where the dynamic type cannot change.  */
-  if (!elemental && full_array && copyback)
+  if (!elemental && full_array && copyback && !INTEGER_CST_P (tmp))
  gfc_add_modify (>post, tmp,

[Bug c++/84644] internal compiler error: in warn_misplaced_attr_for_class_type, at cp/decl.c:4718

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

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #3 from Paolo Carlini  ---
On it.

[Bug fortran/87566] ICE with class(*) and select

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87566

--- Comment #2 from Tobias Burnus  ---
Created attachment 44831
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44831=edit
Partial draft patch

If I apply the attached patch (no idea whether it really makes sense, CLASS is
quite confusing!), it converts to gimple but then fails because of the
following.

For some odd reasons the gimplfier does not like that f951 assigns a value to
the digit 0 (last but one line of the "finally") ...
[Otherwise, the code looks fine to me.]

  struct __class__STAR_1_0p * point;
  struct __class__STAR_1_0p class.0;
 class.0._data = __tmp_class_object_array_pointer->_data->p._data;
 class.0._vptr = __tmp_class_object_array_pointer->_data->p._vptr;
...
 point = 
...
 finally
   {
 __tmp_class_object_array_pointer->_data->p._data = class.0._data;
 __tmp_class_object_array_pointer->_data->p._vptr = class.0._vptr;
 0 = (unsigned long) class.0._len;
 __tmp_class_object_array_pointer->_data->p._len = class.0._len;

[Bug middle-end/81376] unnecessary cast before comparison

2018-10-12 Thread ygribov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81376

--- Comment #4 from Yury Gribov  ---
Author: ygribov
Date: Fri Oct 12 20:35:20 2018
New Revision: 265131

URL: https://gcc.gnu.org/viewcvs?rev=265131=gcc=rev
Log:
Add pattern to remove useless float casts in comparisons.

PR middle-end/81376

gcc/
* real.c (format_helper::can_represent_integral_type_p): New function
* real.h (format_helper::can_represent_integral_type_p): Ditto.
* match.pd: New pattern.

gcc/testsuite/
* c-c++-common/pr81376.c: New test.
* gcc.target/i386/387-ficom-2.c: Update test.
* gcc.target/i386/387-ficom-2.c: Ditto.

Added:
trunk/gcc/testsuite/c-c++-common/pr81376.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/match.pd
trunk/gcc/real.c
trunk/gcc/real.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/i386/387-ficom-1.c
trunk/gcc/testsuite/gcc.target/i386/387-ficom-2.c

[Bug c++/87602] New: Out of Memory problem caused by Integer Overflow in c++filt

2018-10-12 Thread wcventure at 126 dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87602

Bug ID: 87602
   Summary: Out of Memory problem caused by Integer Overflow in
c++filt
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wcventure at 126 dot com
  Target Milestone: ---

Created attachment 44830
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44830=edit
POC_input

Hi. We are doing research on Fuzz testing. Our fuzzer caught an Out of Memory
problem in program c++filt of the latest binutils(v2.31.1) code base, a
malicious input of format strings will cause the LargeMmapAllocator faults and
I have confirmed it with address sanitizer too. This Bug is caused by Integer
Overflow.

The way to reproduce the bug:
I have provided the POC file and the
input(_rttt46__H766__c). Please use the "./c++filt < $POC"
to reproduce the bug. Another way to reproduce this bug is type "c++filt
_rttt46__H766__c" directly. If you have any questions,
please let me know.


The ASAN dumps the stack trace as follows:
cplus-dem.c:3597:10: runtime error: signed integer overflow: 7 * 10
cannot be represented in type 'int'
SUMMARY: AddressSanitizer: undefined-behavior cplus-dem.c:3597:10 in
==13543==WARNING: AddressSanitizer failed to allocate 0xfffd6ff0 bytes
==13543==AddressSanitizer's allocator is terminating the process instead of
returning 0
==13543==If you don't like this behavior set allocator_may_return_null=1
==13543==AddressSanitizer CHECK failed:
/build/llvm-toolchain-3.8-_PD09B/llvm-toolchain-3.8-3.8/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:147
"((0))
)" (0x0, 0x0)
#0 0x4c2a2d 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4c2a2d)
#1 0x4c9653 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4c9653)
#2 0x4c71d6 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4c71d6)
#3 0x41efec 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x41efec)
#4 0x4b9401 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4b9401)
#5 0x21e42be 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x21e42be)
#6 0x1ffc3b7 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x1ffc3b7)
#7 0x1fe8a17 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x1fe8a17)
#8 0x2039f37 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x2039f37)
#9 0x1fcbb2c 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x1fcbb2c)
#10 0x1fb8b23 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x1fb8b23)
#11 0x4eef03 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4eef03)
#12 0x4ed203 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x4ed203)
#13 0x7f49e9d5182f  (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#14 0x419318 
(/media/hjwang/01D3344861A8D2E0/wcventure/Project/binutils_latest_AFL_ASAN/build/bin/c++filt+0x419318)

Aborted

[Bug target/87601] New: Missed opportunity for flag reuse and macro-op fusion on x86

2018-10-12 Thread vgatherps at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87601

Bug ID: 87601
   Summary: Missed opportunity for flag reuse and macro-op fusion
on x86
   Product: gcc
   Version: 8.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vgatherps at gmail dot com
  Target Milestone: ---

When I compile the following code with gcc 8.2 and options -O2 (or Os) and
-mtune=intel (or broadwell):

int sum(int *vals, int l) {
int a = 0;
if (l <= 0) {
return 0;
}
for (int i = l; i != 0; i--) {
a += vals[i-1];
}
return a;
}


The following code is generated:

sum(int*, int):
  xor eax, eax
  test esi, esi
  jle .L1
  movsx rsi, esi
.L3:
  add eax, DWORD PTR [rdi-4+rsi*4]
  sub rsi, 1
  test esi, esi
  jne .L3
.L1:
  ret


When passing -march=broadwell or -Os, sub is replaced by dec but otherwise it's
the same.

Inside the loop, the sequence:
  sub rsi, 1
  test esi, esi
  jne .L3

can be replaced with:
  sub rsi, 1
  jne .L3

since sub rsi, 1 since that would set the same zero flag that test would. This
would improve macro-op fusion on relatively recent architectures as well.
Anecdotally, I've seen similar decisions being made along the lines of 

sub index, 1

// some more asm here not using index

test index, index
jne loop_start

But don't have a nice clean test case for it. This suggests to me that the
optimization around flag reuse and macro-op fusion could be improved in
general, and I'll work on getting some clean test cases for other cases.

[Bug fortran/87597] [6/7/8/9 Regression] wrong result with matmul inlining

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87597

--- Comment #6 from Tobias Burnus  ---
Author: burnus
Date: Fri Oct 12 18:18:13 2018
New Revision: 265126

URL: https://gcc.gnu.org/viewcvs?rev=265126=gcc=rev
Log:
Fix off-by-one issue with inline matmul

PR fortran/87597
* expr.c (gfc_simplify_expr): Avoid simplifying
the 'array' argument to lbound/ubound/lcobound/
ucobound.

PR fortran/87597
* gfortran.dg/inline_matmul_24.f90: New.


Added:
trunk/gcc/testsuite/gfortran.dg/inline_matmul_24.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/58787] ICE (error recovery) in check_proc_interface

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58787

Tobias Burnus  changed:

   What|Removed |Added

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

--- Comment #17 from Tobias Burnus  ---
FIXED – almost exactly after 5 years after reporting it.

[Bug fortran/29670] [meta-bug] fortran interfaces

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29670
Bug 29670 depends on bug 58787, which changed state.

Bug 58787 Summary: ICE (error recovery) in check_proc_interface
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58787

   What|Removed |Added

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

[Bug fortran/58787] ICE (error recovery) in check_proc_interface

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58787

--- Comment #16 from Tobias Burnus  ---
Author: burnus
Date: Fri Oct 12 18:13:25 2018
New Revision: 265125

URL: https://gcc.gnu.org/viewcvs?rev=265125=gcc=rev
Log:
Fix error-recovery ICE in check_proc_interface

PR fortran/58787
* decl.c (get_proc_name): Return with error before
creating sym_tree.

PR fortran/58787
* gfortran.dg/goacc/pr77765.f90: Modify dg-error.
* gfortran.dg/interface_42.f90: Ditto.
* gfortran.dg/internal_references_1.f90: Ditto.
* gfortran.dg/invalid_procedure_name.f90: Ditto.
* gfortran.dg/pr65453.f90: Ditto.
* gfortran.dg/pr77414.f90: Ditto.
* gfortran.dg/pr78741.f90: Ditto.
* gfortran.dg/same_name_2.f90: Ditto.


Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/goacc/pr77765.f90
trunk/gcc/testsuite/gfortran.dg/interface_42.f90
trunk/gcc/testsuite/gfortran.dg/internal_references_1.f90
trunk/gcc/testsuite/gfortran.dg/invalid_procedure_name.f90
trunk/gcc/testsuite/gfortran.dg/pr65453.f90
trunk/gcc/testsuite/gfortran.dg/pr77414.f90
trunk/gcc/testsuite/gfortran.dg/pr78741.f90
trunk/gcc/testsuite/gfortran.dg/same_name_2.f90

[Bug middle-end/86815] [8/9 regression] ICE on valid code on armhf

2018-10-12 Thread costamagnagianfranco at yahoo dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86815

Gianfranco  changed:

   What|Removed |Added

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

--- Comment #12 from Gianfranco  ---
Fortunately this seems to be not an issue anymore, with latest toolchain
fixes...
I still have a test failure, probably due to unaligned armhf access.
Closing as fixed (not sure if in qt side or gcc side, but now it builds
correctly with the same configuration as the one who caused this bug, only
toolchain updated!)

thanks you all

G.

[Bug target/87550] Intrinsics for rdpmc (__rdpmc, __builtin_ia32_rdpmc) are interpreted as pure functions

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87550

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:34:07 2018
New Revision: 265122

URL: https://gcc.gnu.org/viewcvs?rev=265122=gcc=rev
Log:
Backported from mainline
2018-10-10  Jakub Jelinek  

PR target/87550
* config/i386/i386.c (bdesc_args): Move IX86_BUILTIN_RDPMC
from here to ...
(bdesc_special_args): ... here.

* gcc.target/i386/pr87550.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr87550.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/i386/i386.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/87248] [6/7 Regression] Bad code for masked operations involving signed ints

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87248

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:33:25 2018
New Revision: 265121

URL: https://gcc.gnu.org/viewcvs?rev=265121=gcc=rev
Log:
Backported from mainline
2018-09-12  Jakub Jelinek  

PR middle-end/87248
* fold-const.c (fold_ternary_loc) : Verify also that
BIT_AND_EXPR's second operand is a power of two.  Formatting fix.

* c-c++-common/torture/pr87248.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/c-c++-common/torture/pr87248.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/fold-const.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/87065] [7 Regression] combine causes ICE in trunc_int_for_mode

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87065

--- Comment #13 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:32:38 2018
New Revision: 265120

URL: https://gcc.gnu.org/viewcvs?rev=265120=gcc=rev
Log:
Backported from mainline
2018-08-27  Jakub Jelinek  

PR rtl-optimization/87065
* combine.c (simplify_if_then_else): Formatting fix.
(if_then_else_cond): Guard MULT optimization with SCALAR_INT_MODE_P
check.
(known_cond): Don't return const_true_rtx for vector modes.  Use
CONST0_RTX instead of const0_rtx.  Formatting fixes.

* gcc.target/i386/pr87065.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr87065.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/combine.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/86627] [6/7 Regression] Signed 128-bit division by 2 no longer expanded to RTL

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86627

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:31:33 2018
New Revision: 265119

URL: https://gcc.gnu.org/viewcvs?rev=265119=gcc=rev
Log:
Backported from mainline
2018-07-24  Jakub Jelinek  

PR middle-end/86627
* expmed.c (expand_divmod): Punt if d == HOST_WIDE_INT_MIN
and size > HOST_BITS_PER_WIDE_INT.  For size > HOST_BITS_PER_WIDE_INT
and abs_d == d, do the power of two handling if profitable.

* gcc.target/i386/pr86627.c: New test.

Added:
branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr86627.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/expmed.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug middle-end/86539] OpenMP wrong-code with taskloop and references

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86539

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:29:35 2018
New Revision: 265117

URL: https://gcc.gnu.org/viewcvs?rev=265117=gcc=rev
Log:
Backported from mainline
2018-07-17  Jakub Jelinek  

PR middle-end/86539
* gimplify.c (gimplify_omp_for): Ensure taskloop firstprivatized init
and cond temporaries don't have reference type if iterator has
pointer type.  For init use _pre_body instead of pre_p if
for_pre_body is non-empty.

* testsuite/libgomp.c++/pr86539.C: New test.

Added:
branches/gcc-6-branch/libgomp/testsuite/libgomp.c++/pr86539.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/gimplify.c
branches/gcc-6-branch/libgomp/ChangeLog

[Bug middle-end/86542] wrong-code for collapsed taskloop which needs omp_cpyfn

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86542

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:30:45 2018
New Revision: 265118

URL: https://gcc.gnu.org/viewcvs?rev=265118=gcc=rev
Log:
Backported from mainline
2018-07-17  Jakub Jelinek  

PR middle-end/86542
* omp-low.c (create_task_copyfn): Copy over also fields corresponding
to _looptemp_ clauses, other than the first two.

* testsuite/libgomp.c++/pr86542.C: New test.

Added:
branches/gcc-6-branch/libgomp/testsuite/libgomp.c++/pr86542.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/omp-low.c
branches/gcc-6-branch/libgomp/ChangeLog

[Bug middle-end/86660] libgomp.c++/for-15.C ICEs with nvptx offloading

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

--- Comment #18 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:28:51 2018
New Revision: 265116

URL: https://gcc.gnu.org/viewcvs?rev=265116=gcc=rev
Log:
Backported from mainline
2018-07-26  Jakub Jelinek  

PR middle-end/86660
* omp-low.c (scan_sharing_clauses): Don't ignore map clauses for
declare target to variables if they have always,{to,from,tofrom} map
kinds.

* testsuite/libgomp.c/pr86660.c: New test.

Added:
branches/gcc-6-branch/libgomp/testsuite/libgomp.c/pr86660.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/omp-low.c
branches/gcc-6-branch/libgomp/ChangeLog

[Bug c++/86208] [6/7 Regression] improper handling of an extern declared inline function

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86208

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:27:56 2018
New Revision: 265115

URL: https://gcc.gnu.org/viewcvs?rev=265115=gcc=rev
Log:
Backported from mainline
2018-07-16  Jakub Jelinek  

PR c++/3698
PR c++/86208
* cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or
in TREE_USED flag from stmt to h->to.

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

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr3698.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/cp-gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/3698] improper handling of an extern declared inline function

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3698

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 17:27:56 2018
New Revision: 265115

URL: https://gcc.gnu.org/viewcvs?rev=265115=gcc=rev
Log:
Backported from mainline
2018-07-16  Jakub Jelinek  

PR c++/3698
PR c++/86208
* cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or
in TREE_USED flag from stmt to h->to.

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

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr3698.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/cp-gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/84423] [6/7/8 Regression] [concepts] ICE with invalid using declaration

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

Paolo Carlini  changed:

   What|Removed |Added

Summary|[6/7/8/9 Regression]|[6/7/8 Regression]
   |[concepts] ICE with invalid |[concepts] ICE with invalid
   |using declaration   |using declaration

--- Comment #7 from Paolo Carlini  ---
Fixed in trunk (for 9.0) so far.

[Bug target/86677] popcount builtin detection is breaking some kernel build

2018-10-12 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86677

--- Comment #7 from rguenther at suse dot de  ---
On October 12, 2018 6:57:44 PM GMT+02:00, "wilco at gcc dot gnu.org"
 wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86677
>
>Wilco  changed:
>
>   What|Removed |Added
>
>   CC||wilco at gcc dot gnu.org
>
>--- Comment #6 from Wilco  ---
>(In reply to rguent...@suse.de from comment #5)
>> On Wed, 10 Oct 2018, ktkachov at gcc dot gnu.org wrote:
>> 
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86677
>> > 
>> > ktkachov at gcc dot gnu.org changed:
>> > 
>> >What|Removed |Added
>> >
>
>> >  CC||ktkachov at gcc
>dot gnu.org
>> > 
>> > --- Comment #3 from ktkachov at gcc dot gnu.org ---
>> > GCC does disable some pattern recognition with
>> > -fno-tree-loop-distribute-patterns, which is implied by
>-ffreestanding (used by
>> > the kernel). Wouldn't it be consistent to disable this pattern
>recognition in
>> > that setup as well? popcount is not such a fundamental helper
>function like
>> > e.g. DImode shifts, after all
>> 
>> I am not against adding a new switch for this (not sure if we really
>> should overload -fno-tree-loop-distribute-patterns with this since
>> this will disable popcount recognition at anything below -O3).
>
>Would it not make sense to check that the popcount optab is implemented
>and
>enabled before using it? Calling a library function that does a similar
>loop
>will be slower than keeping the original loop.

Sure. There's a thread on gcc patches for this.

[Bug target/87376] [avr] Miscompilation with __memx and long long addition

2018-10-12 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87376

--- Comment #4 from Georg-Johann Lay  ---
Unfortunately, the solution from above won't work for PR65657, an issue that is
basically the same: early use of explicit hard-regs and propagations from TER.

Hence -fno-tree-ter can be used as work-around for both PRs.

In order to avoid explicit hard-regs altogether, we'll have to use 5 new
regclasses and constraints to describe the hard regs:  A 1-byte class for R21
and 4 classes for R22... that span 1...4 bytes.  Up to split1 there will be an
ordinar mov insn from memx.  split1 will split the 24-bit address into the high
byte to pass in R21 and the low word to pass in Z similar to the current 
xload_A -> xload__libgcc  split.

[Bug target/86677] popcount builtin detection is breaking some kernel build

2018-10-12 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86677

Wilco  changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #6 from Wilco  ---
(In reply to rguent...@suse.de from comment #5)
> On Wed, 10 Oct 2018, ktkachov at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86677
> > 
> > ktkachov at gcc dot gnu.org changed:
> > 
> >What|Removed |Added
> > 
> >  CC||ktkachov at gcc dot gnu.org
> > 
> > --- Comment #3 from ktkachov at gcc dot gnu.org ---
> > GCC does disable some pattern recognition with
> > -fno-tree-loop-distribute-patterns, which is implied by -ffreestanding 
> > (used by
> > the kernel). Wouldn't it be consistent to disable this pattern recognition 
> > in
> > that setup as well? popcount is not such a fundamental helper function like
> > e.g. DImode shifts, after all
> 
> I am not against adding a new switch for this (not sure if we really
> should overload -fno-tree-loop-distribute-patterns with this since
> this will disable popcount recognition at anything below -O3).

Would it not make sense to check that the popcount optab is implemented and
enabled before using it? Calling a library function that does a similar loop
will be slower than keeping the original loop.

[Bug target/87455] sse_packed_single_insn_optimal is suboptimal on Zen

2018-10-12 Thread fanael4 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87455

--- Comment #5 from Fanael  ---
Created attachment 44829
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44829=edit
WIP patch

> We already have TARGET_SSE_TYPELESS_STORES for stores, so perhaps we want 
> something like typeless reg-reg moves and loads flag?

Something along the lines of the attached patch? It's work-in-progress and only
very lightly tested, but appears to work.

[Bug target/87376] [avr] Miscompilation with __memx and long long addition

2018-10-12 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87376

Georg-Johann Lay  changed:

   What|Removed |Added

 CC||jonathan.creekmore@synapse-
   ||wireless.com

--- Comment #3 from Georg-Johann Lay  ---
*** Bug 65657 has been marked as a duplicate of this bug. ***

[Bug target/65657] [avr] read from __memx address space tramples argument to following function

2018-10-12 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65657

--- Comment #7 from Georg-Johann Lay  ---


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

[Bug rtl-optimization/87600] Fix for PRs 86939 and 87479 causes build issues for several targets

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87600

--- Comment #2 from Peter Bergner  ---
Author: bergner
Date: Fri Oct 12 16:31:11 2018
New Revision: 265113

URL: https://gcc.gnu.org/viewcvs?rev=265113=gcc=rev
Log:
PR rtl-optimization/87600
* ira-lives (non_conflicting_reg_copy_p): Disable for non LRA targets.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ira-lives.c

[Bug target/87599] Broadcasting scalar to vector uses stack unnecessarily on x86

2018-10-12 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87599

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #3 from Alexander Monakov  ---
The problem is when movddup is available (with -msse3), IRA selects the movddup
alternative in the vec_dupv2di pattern - perhaps something is off there?

(to be clear: '-O2 -mtune=intel' - good, '-O2 -mtune=intel -msse3' - bad)

[Bug rtl-optimization/87600] Fix for PRs 86939 and 87479 causes build issues for several targets

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87600

--- Comment #1 from Peter Bergner  ---
Pasting some edited commentary from the gcc-patches mailing list:

On 10/8/18 9:52 AM, Jeff Law wrote:
> My tester is showing a variety of problems as well.  hppa, sh4, aarch64,
> aarch64_be, alpha arm* and s390x bootstraps are all failing at various
> points.   Others may trickle in over time, but clearly something went
> wrong recently.  I'm going to start trying to pick them off after the
> morning meetings are wrapped up.

I looked into the PA-RISC test case issue Jeff sent me that is caused by my
patch that handles conflicts wrt reg copies and I _think_ I have a handle
on what the problem is, but don't yet know how to fix.  Jeff, I agree with
the analysis you gave in your email to me, but to get Vlad up to speed, here
it is again along with some additional info.

Compiling the test case, we have the following RTL during IRA.  I have also
annotated the pseudos in the RTL to include their hard reg assignment:

(insn 30 19 32 3 (set (reg/f:SI 112 "%r19") ))
(insn 32 30 20 3 (set (reg:SI 26 %r26)
  (reg/f:SI 101 "%r26")))
[snip]
(insn 23 22 49 3 (set (reg:SI 109 "%r28")
 (mem:SI (reg/f:SI 101 "%r26"
(insn 49 23 31 3 (set (reg/f:SI 100 "%r28")
(if_then_else:SI (eq (reg:SI 109 "%r28") (const_int 15 [0xf]))
(reg/f:SI 101 "%r26")
(const_int 0 [0])))
 (expr_list:REG_DEAD (reg:SI 109 "%r28")
(expr_list:REG_DEAD (reg/f:SI 101 "%r26"
(insn 31 49 33 3 (set (mem/f:SI (reg/f:SI 112 "%r19"))
  (reg/f:SI 100 "%r28"))
 (expr_list:REG_DEAD (reg/f:SI 112 "%r19")
(expr_list:REG_DEAD (reg/f:SI 100 "%r28"
(call_insn 33 31 36 3 (parallel [
(call (mem:SI (symbol_ref/v:SI ("@_Z3yowP11dw_cfi_node"))
(const_int 16 [0x10]))
(clobber (reg:SI 1 %r1))
(clobber (reg:SI 2 %r2))
(use (const_int 0 [0]))])
 (expr_list:REG_DEAD (reg:SI 26 %r26))
(expr_list:SI (use (reg:SI 26 %r26)

Before my patch, hard reg %r26 and pseudo 101 conflicted, but with my patch
they now (correctly) do not.  IRA is able to assign hard regs to all of the
pseudos, but the constraints in the pattern for insn 49 forces op0 (pseudo 100)
and op1 (pseudo 101) to have the same hard reg.  They are not, so reload comes
along and spills insn 49 with the following reloads:

Reloads for insn # 49
Reload 0: reload_in (SI) = (reg/f:SI 26 %r26 [orig:101 _10 ] [101])
  reload_out (SI) = (reg/f:SI 28 %r28 [orig:100 iftmp.2_5 ] [100])
  GENERAL_REGS, RELOAD_OTHER (opnum = 0)
  reload_in_reg: (reg/f:SI 26 %r26 [orig:101 _10 ] [101])
  reload_out_reg: (reg/f:SI 28 %r28 [orig:100 iftmp.2_5 ] [100])
  reload_reg_rtx: (reg/f:SI 26 %r26 [orig:101 _10 ] [101])

..giving us the following updated insn:

(insn 49 23 58 3 (set (reg/f:SI 26 %r26 [101])
(if_then_else:SI (eq (reg:SI 28 %r28 [109])
(const_int 15))
(reg/f:SI 26 %r26 [101])
(const_int 0 [0]

The problem is, that hard reg %r26 is defined in insn 32, to be used in
insn 33, so using %r26 as the reload reg is wrong, because it will clobber
the value we set in insn 32.  HPPA is a reload (not LRA) target and looking
thru reload, it assumes that if any input pseudo dies in an insn, then the
hard reg assigned to the pseudo is free game for use with an output reload.
With my patch, that assumption is (now) wrong, because another simultaneously
live pseudo may be using that same hard reg or in this case, the hard reg
itself is still live.

Given no one wants to patch reload, the decision has been made to disable
the special reg copy handling my patch introduced whenever we're compiling
for a reload target via the following patch:

Index: gcc/ira-lives.c
===
--- gcc/ira-lives.c (revision 264897)
+++ gcc/ira-lives.c (working copy)
@@ -1064,6 +1064,11 @@ find_call_crossed_cheap_reg (rtx_insn *i
 rtx
 non_conflicting_reg_copy_p (rtx_insn *insn)
 {
+  /* Reload has issues with overlapping pseudos being assigned to the
+ same hard register, so don't allow it.  See PR87600 for details.  */
+  if (!targetm.lra_p ())
+return NULL_RTX;
+
   rtx set = single_set (insn);

   /* Disallow anything other than a simple register to register copy

[Bug rtl-optimization/87600] Fix for PRs 86939 and 87479 causes build issues for several targets

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87600

Peter Bergner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2018-10-12
 CC||dje at gcc dot gnu.org,
   ||law at gcc dot gnu.org,
   ||segher at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org,
   ||wschmidt at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |bergner at gcc dot 
gnu.org
   Target Milestone|--- |9.0
 Ever confirmed|0   |1

[Bug rtl-optimization/87600] New: Fix for PRs 86939 and 87479 causes build issues for several targets

2018-10-12 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87600

Bug ID: 87600
   Summary: Fix for PRs 86939 and 87479 causes build issues for
several targets
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

The IRA/LRA fix (revision 264897) for PR86939 and PR87479 has caused build
issues on several targets.  This bugzilla entry will be used to track the
change(s) required to get the targets building again.

The affected targets seem to be: aarch64, alpha, arm, hppa, s390x and sh4.

[Bug target/87550] Intrinsics for rdpmc (__rdpmc, __builtin_ia32_rdpmc) are interpreted as pure functions

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87550

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:55:17 2018
New Revision: 265112

URL: https://gcc.gnu.org/viewcvs?rev=265112=gcc=rev
Log:
Backported from mainline
2018-10-10  Jakub Jelinek  

PR target/87550
* config/i386/i386-builtin.def (IX86_BUILTIN_RDPMC): Move from args set
to special_args set.

* gcc.target/i386/pr87550.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr87550.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386-builtin.def
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/87248] [6/7 Regression] Bad code for masked operations involving signed ints

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87248

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[6/7/8/9 Regression] Bad|[6/7 Regression] Bad code
   |code for masked operations  |for masked operations
   |involving signed ints   |involving signed ints

--- Comment #5 from Jakub Jelinek  ---
Fixed for 8.3+ so far.

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:54:34 2018
New Revision: 265111

URL: https://gcc.gnu.org/viewcvs?rev=265111=gcc=rev
Log:
Backported from mainline
2018-09-12  Jakub Jelinek  

PR middle-end/87248
* fold-const.c (fold_ternary_loc) : Verify also that
BIT_AND_EXPR's second operand is a power of two.  Formatting fix.

* c-c++-common/torture/pr87248.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/torture/pr87248.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/fold-const.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/87065] [7 Regression] combine causes ICE in trunc_int_for_mode

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87065

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:53:54 2018
New Revision: 265110

URL: https://gcc.gnu.org/viewcvs?rev=265110=gcc=rev
Log:
Backported from mainline
2018-08-27  Jakub Jelinek  

PR rtl-optimization/87065
* combine.c (simplify_if_then_else): Formatting fix.
(if_then_else_cond): Guard MULT optimization with SCALAR_INT_MODE_P
check.
(known_cond): Don't return const_true_rtx for vector modes.  Use
CONST0_RTX instead of const0_rtx.  Formatting fixes.

* gcc.target/i386/pr87065.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr87065.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/combine.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/86627] [6/7 Regression] Signed 128-bit division by 2 no longer expanded to RTL

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86627

--- Comment #11 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:53:11 2018
New Revision: 265109

URL: https://gcc.gnu.org/viewcvs?rev=265109=gcc=rev
Log:
Backported from mainline
2018-07-24  Jakub Jelinek  

PR middle-end/86627
* expmed.c (expand_divmod): Punt if d == HOST_WIDE_INT_MIN
and size > HOST_BITS_PER_WIDE_INT.  For size > HOST_BITS_PER_WIDE_INT
and abs_d == d, do the power of two handling if profitable.

* gcc.target/i386/pr86627.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr86627.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expmed.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/86542] wrong-code for collapsed taskloop which needs omp_cpyfn

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86542

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:52:18 2018
New Revision: 265108

URL: https://gcc.gnu.org/viewcvs?rev=265108=gcc=rev
Log:
Backported from mainline
2018-07-17  Jakub Jelinek  

PR middle-end/86542
* omp-low.c (create_task_copyfn): Copy over also fields corresponding
to _looptemp_ clauses, other than the first two.

* testsuite/libgomp.c++/pr86542.C: New test.

Added:
branches/gcc-7-branch/libgomp/testsuite/libgomp.c++/pr86542.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/omp-low.c
branches/gcc-7-branch/libgomp/ChangeLog

[Bug middle-end/86539] OpenMP wrong-code with taskloop and references

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86539

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:49:32 2018
New Revision: 265107

URL: https://gcc.gnu.org/viewcvs?rev=265107=gcc=rev
Log:
Backported from mainline
2018-07-17  Jakub Jelinek  

PR middle-end/86539
* gimplify.c (gimplify_omp_for): Ensure taskloop firstprivatized init
and cond temporaries don't have reference type if iterator has
pointer type.  For init use _pre_body instead of pre_p if
for_pre_body is non-empty.

* testsuite/libgomp.c++/pr86539.C: New test.

Added:
branches/gcc-7-branch/libgomp/testsuite/libgomp.c++/pr86539.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/gimplify.c
branches/gcc-7-branch/libgomp/ChangeLog

[Bug fortran/86421] OpenMP declare simd linear ref in module causes gfortran to bail out

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86421

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:47:57 2018
New Revision: 265106

URL: https://gcc.gnu.org/viewcvs?rev=265106=gcc=rev
Log:
Backported from mainline
2018-07-10  Jakub Jelinek  

PR fortran/86421
* module.c (omp_declare_simd_clauses): Add LINEAR with _REF, _VAL and
_UVAL suffixes.
(mio_omp_declare_simd): Save and restore ref, val and uval modifiers
on linear clauses.  Initialize n->where to gfc_current_locus.

* gfortran.dg/vect/pr86421.f90: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/vect/pr86421.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/module.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug middle-end/86660] libgomp.c++/for-15.C ICEs with nvptx offloading

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86660

--- Comment #17 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:46:18 2018
New Revision: 265105

URL: https://gcc.gnu.org/viewcvs?rev=265105=gcc=rev
Log:
Backported from mainline
2018-07-26  Jakub Jelinek  

PR middle-end/86660
* omp-low.c (scan_sharing_clauses): Don't ignore map clauses for
declare target to variables if they have always,{to,from,tofrom} map
kinds.

* testsuite/libgomp.c/pr86660.c: New test.

Added:
branches/gcc-7-branch/libgomp/testsuite/libgomp.c/pr86660.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/omp-low.c
branches/gcc-7-branch/libgomp/ChangeLog

[Bug c++/3698] improper handling of an extern declared inline function

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3698

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:43:18 2018
New Revision: 265103

URL: https://gcc.gnu.org/viewcvs?rev=265103=gcc=rev
Log:
Backported from mainline
2018-07-16  Jakub Jelinek  

PR c++/3698
PR c++/86208
* cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or
in TREE_USED flag from stmt to h->to.

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

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/opt/pr3698.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/86208] [6/7 Regression] improper handling of an extern declared inline function

2018-10-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86208

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Oct 12 14:43:18 2018
New Revision: 265103

URL: https://gcc.gnu.org/viewcvs?rev=265103=gcc=rev
Log:
Backported from mainline
2018-07-16  Jakub Jelinek  

PR c++/3698
PR c++/86208
* cp-gimplify.c (cp_genericize_r): When using extern_decl_map, or
in TREE_USED flag from stmt to h->to.

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

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/opt/pr3698.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/87599] Broadcasting scalar to vector uses stack unnecessarily on x86

2018-10-12 Thread vgatherps at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87599

--- Comment #2 from vgatherps at gmail dot com ---
Thanks! That fixes the optimization. However, using something like
-march=haswell or -march=corei7 does not result in this optimization being
made, which as far as I know -march= would imply -mtune=intel.

[Bug target/87599] Broadcasting scalar to vector uses stack unnecessarily on x86

2018-10-12 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87599

--- Comment #1 from Andrew Pinski  ---
Try with -mtune=intel. So AMD cores are faster with the move between gpr and
sse register sets via memory rather than direct

[Bug target/87599] New: Broadcasting scalar to vector uses stack unnecessarily on x86

2018-10-12 Thread vgatherps at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87599

Bug ID: 87599
   Summary: Broadcasting scalar to vector uses stack unnecessarily
on x86
   Product: gcc
   Version: 8.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vgatherps at gmail dot com
  Target Milestone: ---

When compiled on GCC 8.2 with -O2, 

typedef long long __m128i __attribute__ ((__vector_size__ (16),
__may_alias__));

__m128i vectorize(long val) {
__m128i rval = {val, val};
return rval;
}

generates the following code:

mov QWORD PTR [rsp-16], rdi
movqxmm0, QWORD PTR [rsp-16]
punpcklqdq  xmm0, xmm0
ret

Which could be replaced with

movqxmm0, rdi
punpcklqdq  xmm0, xmm0
ret

Interestingly, according to godbolt, the current trunk makes this optimization
with -Os but not with -O2 or -O3.

[Bug rtl-optimization/82803] Wildly excessive calls to __tls_get_addr with optimizations enabled.

2018-10-12 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82803

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #5 from Alexander Monakov  ---
The main reason is __tls_get_addr emitted as a normal call on RTL (for each
GIMPLE access to the variable), but unless I'm missing something RTL doesn't
have a notion of pure/const calls, so RTL loop invariant motion and CSE cannot
clean up the redundant calls.

On i386, ___tls_get_addr is modeled as an unspec instead, which is successfully
moved out of the loop during RTL invariant motion.

[Bug tree-optimization/80032] [6 Regression] C++ excessive stack usage (no stack reuse)

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80032

--- Comment #16 from Richard Biener  ---
Author: rguenth
Date: Fri Oct 12 13:44:35 2018
New Revision: 265101

URL: https://gcc.gnu.org/viewcvs?rev=265101=gcc=rev
Log:
2018-10-12  Richard Biener  

PR c++/54278
Backport from mainline
2017-03-23  Richard Biener  

PR tree-optimization/80032
* gimplify.c (gimple_push_cleanup): Forced unconditional
cleanups still have to go to the conditional_cleanups
sequence.

2017-03-21  Richard Biener  

PR tree-optimization/80032
* gimplify.c (gimple_push_cleanup): Add force_uncond parameter,
if set force the cleanup to happen unconditionally.
(gimplify_target_expr): Push inserted clobbers with force_uncond
to avoid them being removed by control-dependent DCE.

* g++.dg/opt/pr80032.C: New testcase.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr80032.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/54278] [6 regression] __attribute__((noreturn)) called from destructor when another auto-scoped variable has a non-trivial dtor erroneously fails with "control reaches end of non-void functio

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54278

--- Comment #7 from Richard Biener  ---
Author: rguenth
Date: Fri Oct 12 13:44:35 2018
New Revision: 265101

URL: https://gcc.gnu.org/viewcvs?rev=265101=gcc=rev
Log:
2018-10-12  Richard Biener  

PR c++/54278
Backport from mainline
2017-03-23  Richard Biener  

PR tree-optimization/80032
* gimplify.c (gimple_push_cleanup): Forced unconditional
cleanups still have to go to the conditional_cleanups
sequence.

2017-03-21  Richard Biener  

PR tree-optimization/80032
* gimplify.c (gimple_push_cleanup): Add force_uncond parameter,
if set force the cleanup to happen unconditionally.
(gimplify_target_expr): Push inserted clobbers with force_uncond
to avoid them being removed by control-dependent DCE.

* g++.dg/opt/pr80032.C: New testcase.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/opt/pr80032.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/gimplify.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/54278] [6 regression] __attribute__((noreturn)) called from destructor when another auto-scoped variable has a non-trivial dtor erroneously fails with "control reaches end of non-void functio

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54278

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||6.4.0

--- Comment #6 from Richard Biener  ---
Fixed.

[Bug tree-optimization/80032] [6 Regression] C++ excessive stack usage (no stack reuse)

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80032

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to fail||6.4.0

--- Comment #15 from Richard Biener  ---
Fixed.

[Bug middle-end/86505] [6/7 Regression] __builtin_va_arg_pack_len() computes the number of arguments wrongly

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86505

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Fri Oct 12 13:41:56 2018
New Revision: 265100

URL: https://gcc.gnu.org/viewcvs?rev=265100=gcc=rev
Log:
2018-10-12  Richard Biener  

Backport from mainline
2018-08-23  Richard Biener  

PR middle-end/87024
* tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len
calls.

* gcc.dg/pr87024.c: New testcase.

2018-08-17  Richard Biener  

PR middle-end/86505
* tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len ()
across a va-arg-pack using call adjust its return value accordingly.

* gcc.dg/torture/pr86505.c: New testcase.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr87024.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr86505.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-inline.c

[Bug ipa/87024] [6/7 Regression] ICE in fold_stmt_1

2018-10-12 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87024

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Fri Oct 12 13:41:56 2018
New Revision: 265100

URL: https://gcc.gnu.org/viewcvs?rev=265100=gcc=rev
Log:
2018-10-12  Richard Biener  

Backport from mainline
2018-08-23  Richard Biener  

PR middle-end/87024
* tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len
calls.

* gcc.dg/pr87024.c: New testcase.

2018-08-17  Richard Biener  

PR middle-end/86505
* tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len ()
across a va-arg-pack using call adjust its return value accordingly.

* gcc.dg/torture/pr86505.c: New testcase.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr87024.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr86505.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-inline.c

[Bug fortran/87597] [6/7/8/9 Regression] wrong result with matmul inlining

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87597

--- Comment #5 from Tobias Burnus  ---
Internally, the problem is in frontend-passes.c's
  scalarized_expr(matrix_b)

matrix_b starts as EXPR_VARIABLE with AR_FULL array reference for which a call
to
   lbound(matrix_b, dim=1)
is generated. That's put into gfc_simplify_expr, which calls gfc_simplify_expr
on each argument and then gfc_intrinsic_func_interface.

By the time the expression reaches gfc_simplify_lbound, the EXPR_VARIABLE has
been replaced by an EXPR_ARRAY - and an array constructor has by definition an
lower bound of one.

But in scalarized_expr, we operate on the variable (with lbound = 0) and not on
the array constructor (with lbound = 1)...

[Bug middle-end/86815] [8/9 regression] ICE on valid code on armhf

2018-10-12 Thread costamagnagianfranco at yahoo dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86815

--- Comment #11 from Gianfranco  ---
I would avoid an OOM issue, because even trying to compile a single file makes
it fail...

I'm trying again the same build with updated gcc and I'll report back.

[Bug libstdc++/78595] Unnecessary copies in _Rb_tree

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78595

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|9.0 |7.4

--- Comment #17 from Jonathan Wakely  ---
Fixed for 7.4 and 8.3, but I'm not going to fix it in the gcc-6 branch.

[Bug libstdc++/70966] new_delete_resource() has deinit lifetime issues.

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70966

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|9.0 |6.5

--- Comment #7 from Jonathan Wakely  ---
Fixed for 6.5, 7.4 and 8.3

[Bug libstdc++/87061] [9 Regression] regex cannot be compiled with -std=c++1z -D_GLIBCXX_USE_CXX11_ABI=0

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87061

--- Comment #6 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 13:04:38 2018
New Revision: 265098

URL: https://gcc.gnu.org/viewcvs?rev=265098=gcc=rev
Log:
Fix experimental::pmr typedefs and add tests

The typedefs in  and  don't
need to be in the __cxx11 namespace, because they are only aliases and
so will have the same mangled name as the underlying types.

Backport from mainline
2018-08-22  Jonathan Wakely  

PR libstdc++/87061
* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::match_results, experimental::pmr::cmatch)
(experimental::pmr::smatch, experimental::pmr::wcmatch)
(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
because COW strings don't support C++11 allocator model.
* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::basic_string, experimental::pmr::string)
(experimental::pmr::u16string, experimental::pmr::u32string)
(experimental::pmr::wstring): Likewise.

Backport from mainline
2018-08-15  Jonathan Wakely  

* include/experimental/regex: Remove begin/end macros for namespace.
* include/experimental/string: Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_forward_list.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_map.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_set.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc:
New test.

Added:
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_forward_list.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multimap.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multiset.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_map.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multimap.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multiset.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_set.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/experimental/regex
branches/gcc-6-branch/libstdc++-v3/include/experimental/string

[Bug libstdc++/70966] new_delete_resource() has deinit lifetime issues.

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70966

--- Comment #6 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 13:04:24 2018
New Revision: 265097

URL: https://gcc.gnu.org/viewcvs?rev=265097=gcc=rev
Log:
PR libstdc++/70966 make pmr::new_delete_resource() immortal

Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.

Backport from mainline
2018-07-24  Jonathan Wakely  

PR libstdc++/70966
* include/experimental/memory_resource (__get_default_resource): Use
placement new to create an object with dynamic storage duration.

Backport from mainline
2018-06-20  Jonathan Wakely  

PR libstdc++/70966
* include/experimental/memory_resource (__resource_adaptor_imp): Add
static assertions to enforce requirements on pointer types.
(__resource_adaptor_imp::get_allocator()): Add noexcept.
(new_delete_resource, null_memory_resource): Return address of an
object with dynamic storage duration.
(__null_memory_resource): Remove.
* testsuite/experimental/memory_resource/70966.cc: New.

Added:
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/memory_resource/70966.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/experimental/memory_resource

[Bug c++/42000] missing -Wuninitialized warning on a user-defined class ctor

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42000
Bug 42000 depends on bug 79345, which changed state.

Bug 79345 Summary: [6 Regression] passing yet-uninitialized member as argument 
to base class constructor should warn (-Wunitialized)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79345

   What|Removed |Added

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

[Bug tree-optimization/79345] [6 Regression] passing yet-uninitialized member as argument to base class constructor should warn (-Wunitialized)

2018-10-12 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79345

Eric Gallager  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||egallager at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|6.5 |7.0

--- Comment #19 from Eric Gallager  ---
(In reply to Richard Biener from comment #17)
> Fixed on trunk, no plans for backporting.

No plans for backporting means this can be closed then.

[Bug libstdc++/77537] [6 Regression] pair constructors do not properly SFINAE

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77537

--- Comment #15 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:51:46 2018
New Revision: 265096

URL: https://gcc.gnu.org/viewcvs?rev=265096=gcc=rev
Log:
PR libstdc++/86751 default assignment operators for std::pair

The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

Backport from mainline
2018-07-31  Jonathan Wakely  

PR libstdc++/86751
* include/bits/stl_pair.h (__pair_base): New class with deleted copy
assignment operator.
(pair): Derive from __pair_base.
(pair::operator=): Remove deleted overload.
* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
so that new base class isn't shown in GDB.
* testsuite/20_util/pair/86751.cc: New test.
* testsuite/20_util/pair/ref_assign.cc: New test.

Added:
branches/gcc-7-branch/libstdc++-v3/testsuite/20_util/pair/86751.cc
branches/gcc-7-branch/libstdc++-v3/testsuite/20_util/pair/ref_assign.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/stl_pair.h
branches/gcc-7-branch/libstdc++-v3/python/libstdcxx/v6/printers.py

[Bug libstdc++/78595] Unnecessary copies in _Rb_tree

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78595

--- Comment #16 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:51:40 2018
New Revision: 265095

URL: https://gcc.gnu.org/viewcvs?rev=265095=gcc=rev
Log:
PR libstdc++/78595 implement insertion into maps in terms of emplace

C++14 simplified the specification of the generic insert function
templates to be equivalent to calling emplace (or emplace_hint).
Defining them in terms of emplace takes care of the problems described
in PR 78595, ensuring a single conversion to value_type is done at the
right time.

Backport from mainline
2018-09-03  Jonathan Wakely  

PR libstdc++/78595
* include/bits/stl_map.h (map::insert(_Pair&&))
(map::insert(const_iterator, _Pair&&)): Do emplace instead of insert.
* include/bits/stl_multimap.h (multimap::insert(_Pair&&))
(multimap::insert(const_iterator, _Pair&&)): Likewise.
* include/bits/unordered_map.h (unordered_map::insert(_Pair&&))
(unordered_map::insert(const_iterator, _Pair&&))
(unordered_multimap::insert(_Pair&&))
(unordered_multimap::insert(const_iterator, _Pair&&)): Likewise.
* include/std/type_traits (__enable_if_t): Define for C++11.
* testsuite/23_containers/map/modifiers/insert/78595.cc: New test.
* testsuite/23_containers/multimap/modifiers/insert/78595.cc: New test.
* testsuite/23_containers/unordered_map/modifiers/78595.cc: New test.
* testsuite/23_containers/unordered_multimap/modifiers/78595.cc: New
test.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/23_containers/map/modifiers/insert/78595.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/23_containers/multimap/modifiers/insert/78595.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/78595.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/23_containers/unordered_multimap/modifiers/78595.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/stl_map.h
branches/gcc-7-branch/libstdc++-v3/include/bits/stl_multimap.h
branches/gcc-7-branch/libstdc++-v3/include/bits/unordered_map.h
branches/gcc-7-branch/libstdc++-v3/include/std/type_traits

[Bug libstdc++/70966] new_delete_resource() has deinit lifetime issues.

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70966

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:51:20 2018
New Revision: 265092

URL: https://gcc.gnu.org/viewcvs?rev=265092=gcc=rev
Log:
PR libstdc++/70966 make pmr::new_delete_resource() immortal

Construct the program-wide resource objects using placement new. This
means they have dynamic storage duration and won't be destroyed during
termination.

Backport from mainline
2018-07-24  Jonathan Wakely  

PR libstdc++/70966
* include/experimental/memory_resource (__get_default_resource): Use
placement new to create an object with dynamic storage duration.

Backport from mainline
2018-06-20  Jonathan Wakely  

PR libstdc++/70966
* include/experimental/memory_resource (__resource_adaptor_imp): Add
static assertions to enforce requirements on pointer types.
(__resource_adaptor_imp::get_allocator()): Add noexcept.
(new_delete_resource, null_memory_resource): Return address of an
object with dynamic storage duration.
(__null_memory_resource): Remove.
* testsuite/experimental/memory_resource/70966.cc: New.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/memory_resource/70966.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/experimental/memory_resource

[Bug libstdc++/86751] [6/7/8 Regression] Ambiguous operator= overload for std::pair

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86751

--- Comment #7 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:51:46 2018
New Revision: 265096

URL: https://gcc.gnu.org/viewcvs?rev=265096=gcc=rev
Log:
PR libstdc++/86751 default assignment operators for std::pair

The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

Backport from mainline
2018-07-31  Jonathan Wakely  

PR libstdc++/86751
* include/bits/stl_pair.h (__pair_base): New class with deleted copy
assignment operator.
(pair): Derive from __pair_base.
(pair::operator=): Remove deleted overload.
* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
so that new base class isn't shown in GDB.
* testsuite/20_util/pair/86751.cc: New test.
* testsuite/20_util/pair/ref_assign.cc: New test.

Added:
branches/gcc-7-branch/libstdc++-v3/testsuite/20_util/pair/86751.cc
branches/gcc-7-branch/libstdc++-v3/testsuite/20_util/pair/ref_assign.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/stl_pair.h
branches/gcc-7-branch/libstdc++-v3/python/libstdcxx/v6/printers.py

[Bug libstdc++/87061] [9 Regression] regex cannot be compiled with -std=c++1z -D_GLIBCXX_USE_CXX11_ABI=0

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87061

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:51:29 2018
New Revision: 265093

URL: https://gcc.gnu.org/viewcvs?rev=265093=gcc=rev
Log:
Fix experimental::pmr typedefs and add tests

The typedefs in  and  don't
need to be in the __cxx11 namespace, because they are only aliases and
so will have the same mangled name as the underlying types.

Backport from mainline
2018-08-23  Jonathan Wakely  

* testsuite/21_strings/basic_string/init-list.cc:
Require cxx11-abi.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
Likewise.

Backport from mainline
2018-08-22  Jonathan Wakely  

PR libstdc++/87061
* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::match_results, experimental::pmr::cmatch)
(experimental::pmr::smatch, experimental::pmr::wcmatch)
(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
because COW strings don't support C++11 allocator model.
* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::basic_string, experimental::pmr::string)
(experimental::pmr::u16string, experimental::pmr::u32string)
(experimental::pmr::wstring): Likewise.

Backport from mainline
2018-08-15  Jonathan Wakely  

* include/experimental/regex: Remove begin/end macros for namespace.
* include/experimental/string: Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_forward_list.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_map.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_set.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc:
New test.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_forward_list.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multimap.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multiset.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_map.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multimap.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multiset.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_set.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/experimental/regex
branches/gcc-7-branch/libstdc++-v3/include/experimental/string
   
branches/gcc-7-branch/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc

[Bug c++/85118] [6 Regression] Error when using std::bind with a generic lambda - "cannot bind 'const volatile char&' to an rvalue of type 'const volatile char'"

2018-10-12 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85118

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #9 from Jason Merrill  ---
This doesn't seem worth applying to the 6 branch.

[Bug target/87517] Typo in avx512fintrin.h

2018-10-12 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87517

--- Comment #5 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Fri Oct 12 12:38:28 2018
New Revision: 265091

URL: https://gcc.gnu.org/viewcvs?rev=265091=gcc=rev
Log:
i386: Correct _mm512_mask3_fmaddsub_round_pd

Define _mm512_mask3_fmaddsub_round_pd with
__builtin_ia32_vfmaddsubpd512_mask, instead of
__builtin_ia32_vfmaddpd512_mask.

Backport from mainline
PR target/87517
* config/i386/avx512fintrin.h (_mm512_mask_fmaddsub_round_pd):
Defined with __builtin_ia32_vfmaddsubpd512_mask.

Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/i386/avx512fintrin.h

[Bug fortran/87597] [6/7/8/9 Regression] wrong result with matmul inlining

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87597

--- Comment #4 from Tobias Burnus  ---
(In reply to Dominique d'Humieres from comment #2)
> Workaround: use -fno-frontend-optimize.

Or replace:
   complex, dimension(0:3,0:3), parameter :: gamma5
by
   complex, dimension(1:4,1:4), parameter :: gamma5
also works.

[Bug target/87522] LTO incorrectly merges target specific options

2018-10-12 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87522

--- Comment #7 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Fri Oct 12 12:34:36 2018
New Revision: 265090

URL: https://gcc.gnu.org/viewcvs?rev=265090=gcc=rev
Log:
i386: Don't pass -msse2avx to assembler for -mavx

With

gcc -O2 -fPIC -flto -g -c -o a.o a.c
gcc -O2 -fPIC -flto -g -mavx   -c -o b.o b.c
gcc -shared -O2 -fPIC -flto -g -o lib1.so a.o b.o

LTO correctly generates AVX for b.o and SSE for a.o.  But the GCC driver
passes -msse2avx to assembler, which encodes SSE instructions as AVX
instructions.  We shouldn't pass -msse2avx to assembler for -mavx.

Backport from mainline
PR target/87522
* config/i386/gnu-user.h (ASM_SPEC): Don't pass -msse2avx to
assembler for -mavx.
* config/i386/gnu-user64.h (ASM_SPEC): Likewise.

Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/config/i386/gnu-user.h
branches/gcc-6-branch/gcc/config/i386/gnu-user64.h

[Bug fortran/87597] [6/7/8/9 Regression] wrong result with matmul inlining

2018-10-12 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87597

Tobias Burnus  changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #3 from Tobias Burnus  ---
If I look at the dump, i.e.
   -fdump-tree-original for -O0 -ffrontend-optimize
I get the following for
B = matmul(A,gamma5)

Re-written in Fortran:

  do var1 = 0, 3
do var2 = 0, 3
  do var3 = 0, 3
b(var1,var3) = b(var1,var3) + a(var2,var3) * gamma5(var1+1,var2+1)
  end do
end do
  end do

The "+1" for gamma5 looks wrong!

From the original dump:

  b[NON_LVALUE_EXPR <__var_1_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] =
b[NON_LVALUE_EXPR <__var_1_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] +
a[NON_LVALUE_EXPR <__var_2_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] *
gamma5[(__var_1_do + 1) * 4 + (__var_2_do + 1)];

[Bug libstdc++/77537] [6 Regression] pair constructors do not properly SFINAE

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77537

--- Comment #14 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:28:54 2018
New Revision: 265089

URL: https://gcc.gnu.org/viewcvs?rev=265089=gcc=rev
Log:
PR libstdc++/86751 default assignment operators for std::pair

The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

Backport from mainline
2018-07-31  Jonathan Wakely  

PR libstdc++/86751
* include/bits/stl_pair.h (__pair_base): New class with deleted copy
assignment operator.
(pair): Derive from __pair_base.
(pair::operator=): Remove deleted overload.
* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
so that new base class isn't shown in GDB.
* testsuite/20_util/pair/86751.cc: New test.
* testsuite/20_util/pair/ref_assign.cc: New test.

Added:
branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/pair/86751.cc
branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/pair/ref_assign.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/stl_pair.h
branches/gcc-8-branch/libstdc++-v3/python/libstdcxx/v6/printers.py

[Bug libstdc++/78595] Unnecessary copies in _Rb_tree

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78595

--- Comment #15 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:28:48 2018
New Revision: 265088

URL: https://gcc.gnu.org/viewcvs?rev=265088=gcc=rev
Log:
PR libstdc++/78595 implement insertion into maps in terms of emplace

C++14 simplified the specification of the generic insert function
templates to be equivalent to calling emplace (or emplace_hint).
Defining them in terms of emplace takes care of the problems described
in PR 78595, ensuring a single conversion to value_type is done at the
right time.

Backport from mainline
2018-09-03  Jonathan Wakely  

PR libstdc++/78595
* include/bits/stl_map.h (map::insert(_Pair&&))
(map::insert(const_iterator, _Pair&&)): Do emplace instead of insert.
* include/bits/stl_multimap.h (multimap::insert(_Pair&&))
(multimap::insert(const_iterator, _Pair&&)): Likewise.
* include/bits/unordered_map.h (unordered_map::insert(_Pair&&))
(unordered_map::insert(const_iterator, _Pair&&))
(unordered_multimap::insert(_Pair&&))
(unordered_multimap::insert(const_iterator, _Pair&&)): Likewise.
* include/std/type_traits (__enable_if_t): Define for C++11.
* testsuite/23_containers/map/modifiers/insert/78595.cc: New test.
* testsuite/23_containers/multimap/modifiers/insert/78595.cc: New test.
* testsuite/23_containers/unordered_map/modifiers/78595.cc: New test.
* testsuite/23_containers/unordered_multimap/modifiers/78595.cc: New
test.

Added:
   
branches/gcc-8-branch/libstdc++-v3/testsuite/23_containers/map/modifiers/insert/78595.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/23_containers/multimap/modifiers/insert/78595.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/23_containers/unordered_map/modifiers/78595.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/23_containers/unordered_multimap/modifiers/78595.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/stl_map.h
branches/gcc-8-branch/libstdc++-v3/include/bits/stl_multimap.h
branches/gcc-8-branch/libstdc++-v3/include/bits/unordered_map.h
branches/gcc-8-branch/libstdc++-v3/include/std/type_traits

[Bug libstdc++/87061] [9 Regression] regex cannot be compiled with -std=c++1z -D_GLIBCXX_USE_CXX11_ABI=0

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87061

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:28:36 2018
New Revision: 265086

URL: https://gcc.gnu.org/viewcvs?rev=265086=gcc=rev
Log:
Fix experimental::pmr typedefs and add tests

The typedefs in  and  don't
need to be in the __cxx11 namespace, because they are only aliases and
so will have the same mangled name as the underlying types.

Backport from mainline
2018-08-23  Jonathan Wakely  

* testsuite/21_strings/basic_string/init-list.cc:
Require cxx11-abi.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
Likewise.

Backport from mainline
2018-08-22  Jonathan Wakely  

PR libstdc++/87061
* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::match_results, experimental::pmr::cmatch)
(experimental::pmr::smatch, experimental::pmr::wcmatch)
(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
because COW strings don't support C++11 allocator model.
* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::basic_string, experimental::pmr::string)
(experimental::pmr::u16string, experimental::pmr::u32string)
(experimental::pmr::wstring): Likewise.

Backport from mainline
2018-08-15  Jonathan Wakely  

* include/experimental/regex: Remove begin/end macros for namespace.
* include/experimental/string: Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_forward_list.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc:
New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_map.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multimap.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_multiset.cc: New test.
* testsuite/experimental/polymorphic_allocator/
pmr_typedefs_unordered_set.cc: New test.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc:
New test.

Added:
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_deque.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_forward_list.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_list.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_map.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multimap.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_multiset.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_set.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_map.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multimap.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_multiset.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_unordered_set.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_vector.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/experimental/regex
branches/gcc-8-branch/libstdc++-v3/include/experimental/string
   
branches/gcc-8-branch/libstdc++-v3/testsuite/21_strings/basic_string/init-list.cc

[Bug libstdc++/86751] [6/7/8 Regression] Ambiguous operator= overload for std::pair

2018-10-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86751

--- Comment #6 from Jonathan Wakely  ---
Author: redi
Date: Fri Oct 12 12:28:54 2018
New Revision: 265089

URL: https://gcc.gnu.org/viewcvs?rev=265089=gcc=rev
Log:
PR libstdc++/86751 default assignment operators for std::pair

The solution for PR 77537 causes ambiguities due to the extra copy
assignment operator taking a __nonesuch_no_braces parameter. By making
the base class non-assignable we don't need the extra deleted overload
in std::pair. The copy assignment operator will be implicitly deleted
(and the move assignment operator not declared) as needed. Without the
additional user-provided operator in std::pair the ambiguity is avoided.

Backport from mainline
2018-07-31  Jonathan Wakely  

PR libstdc++/86751
* include/bits/stl_pair.h (__pair_base): New class with deleted copy
assignment operator.
(pair): Derive from __pair_base.
(pair::operator=): Remove deleted overload.
* python/libstdcxx/v6/printers.py (StdPairPrinter): New pretty printer
so that new base class isn't shown in GDB.
* testsuite/20_util/pair/86751.cc: New test.
* testsuite/20_util/pair/ref_assign.cc: New test.

Added:
branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/pair/86751.cc
branches/gcc-8-branch/libstdc++-v3/testsuite/20_util/pair/ref_assign.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/stl_pair.h
branches/gcc-8-branch/libstdc++-v3/python/libstdcxx/v6/printers.py

  1   2   >