[Bug tree-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

Zdenek Sojka  changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #3 from Zdenek Sojka  ---
r275364 is OK, r275369 is BAD -> probably caused by r275365

[Bug tree-optimization/91665] [8/9/10 Regression] ICE in build_vector_from_val, at tree.c:1904

2019-09-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91665

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-09-05
 CC||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
  Known to work||7.4.0
   Target Milestone|--- |8.4
Summary|[9/10 Regression] ICE in|[8/9/10 Regression] ICE in
   |build_vector_from_val, at   |build_vector_from_val, at
   |tree.c:1904 |tree.c:1904
 Ever confirmed|0   |1
  Known to fail||10.0, 8.3.0, 9.2.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r255574.

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645

--- Comment #4 from rguenther at suse dot de  ---
On Wed, 4 Sep 2019, lisyarus at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645
> 
> --- Comment #2 from Nikita Lisitsa  ---
> If by 'isless(y, 0.0)' you mean 'y < 0.f', then no, it doesn't change 
> anything,
> it produces the same 'ucomiss ... call sqrtf' boilerplate. May I have
> misunderstood you?

I meant isless literally, it's from math.h

> By the way, what about '#pragma GCC optimize ("no-math-errno")'? Is it 
> supposed
> to work? Should I issue another bug on that matter?

It should work if the #pragma is before the function start (those pragmas 
only work on function granularity)

[Bug target/91577] [10 Regression] ICE in expand_load_lanes_optab_fn, at internal-fn.c:163 since r274922

2019-09-05 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91577

--- Comment #5 from rsandifo at gcc dot gnu.org  
---
Author: rsandifo
Date: Thu Sep  5 07:50:07 2019
New Revision: 275399

URL: https://gcc.gnu.org/viewcvs?rev=275399&root=gcc&view=rev
Log:
Force IFN_LOAD/STORE_LANES operands to be memory (PR91577)

This patch uses the workaround Richi suggested in the PR: make
discover_nonconstant_array_refs mark the source of an IFN_LOAD_LANES
call and the destination of an IFN_STORE_LANES call as addressable,
so that they don't end up being REG rtxes during expansion.

I had to move the discover_nonconstant_array_refs call outside the
currently_expanding_to_rtl block since otherwise mark_addressable
just queues the decision for later.

2019-09-05  Richard Sandiford  

gcc/
PR middle-end/91577
* cfgexpand.c (discover_nonconstant_array_refs): Force the source
of an IFN_LOAD_LANES call and the destination of an IFN_STORE_LANES
call to be in memory.
(pass_expand::execute): Call discover_nonconstant_array_refs before
setting currently_expanding_to_rtl.

gcc/testsuite/
PR middle-end/91577
* gfortran.dg/pr91577.f90: New test, taken from temporary_1.f90.

Added:
trunk/gcc/testsuite/gfortran.dg/pr91577.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cfgexpand.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-09-05
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |10.0
 Ever confirmed|0   |1

--- Comment #4 from Richard Biener  ---
Mine.

[Bug rtl-optimization/91657] [10 regression] many failures after r275365

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91657

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-09-05
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Target Milestone|--- |10.0
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Mine.

[Bug fortran/91660] [8/9/10 Regression] Missing error on invalid type declaration

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91660

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |8.4

[Bug rtl-optimization/91659] [10 Regression] Revision 275365 is causing a Fortran testsuite failure at -O3

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91659

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-09-05
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
Summary|[Regression 10] Revision|[10 Regression] Revision
   |275365 is causing a Fortran |275365 is causing a Fortran
   |testsuite failure at -O3|testsuite failure at -O3
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Mine.

[Bug target/91577] [10 Regression] ICE in expand_load_lanes_optab_fn, at internal-fn.c:163 since r274922

2019-09-05 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91577

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

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

--- Comment #6 from rsandifo at gcc dot gnu.org  
---
Fixed

[Bug c/91664] Undefined reference linker errors when static linking archive with gcc target_clones function multi-versioning

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91664

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|WAITING |NEW
 CC||marxin at gcc dot gnu.org
  Known to fail||10.0, 8.3.1, 9.2.1

--- Comment #7 from Richard Biener  ---
The issue is that with a declaration like

double fmv_test (double *dArray, int size) __attribute__ ((__target_clones__
("avx2","avx","sse4.1","sse2","default")));

we're creating a resolver even if there's no definition of fmv_test visible.
We shouldn't do that.  We should only emit resolvers for definitions.

[Bug target/88839] [SVE] Poor implementation of blend-like permutes

2019-09-05 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88839

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |10.0

--- Comment #4 from rsandifo at gcc dot gnu.org  
---
Fixed on trunk.

[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635

Jakub Jelinek  changed:

   What|Removed |Added

 CC||segher at gcc dot gnu.org

--- Comment #21 from Jakub Jelinek  ---
(In reply to Jim Wilson from comment #20)
> Created attachment 46830 [details]
> proposed patch to fix paradoxical reg in splitter problem
> 
> I get better code size with this alternative patch.  I added two more
> testcases for the issues I found while evaluating this patch.  There is no
> change to the rv32/newlib libc/libstdc++ library code sizes.  The rv64/linux
> libc.so is now 94 bytes smaller.  The libstdc++.so is 6 bytes larger but
> text is 10 bytes smaller and rodata is 16 bytes larger.  I'm not sure what
> happened there, maybe alignment padding, but I can live with it.  The text
> section looks like the same code, but slightly better register allocation,
> which allows a few more compressed instructions to be used.  This has passed
> rv32/newlib and rv64/linux cross toolchain build and check.  The new
> testcase from Jakub still works, along with my two new testcases.
> 
> I tried adding instrumentation to the patch to abort if I ended up with a
> paradoxical reg in the splitters, and it never triggered, so it looks like
> combine is doing the right thing when allocating a reg for the clobber.

First of all, I think you need to use :DI instead of :GPR for the last
define_split, as it shouldn't be iterated with.
Second, doesn't this mean that the splitters will be matched then only during
combine and never afterwards?
The can_create_pseudo_p () -> gen_reg_rtx (mode) way of adding intermediate
temporaries is used heavily in many other backends, just look at say i386,
rs6000 or aarch64 backends for examples (I've looked only at those 3 and found
many spots in each), so if missing REG_DEAD notes affect code quality, perhaps
it would be more useful to try to change the combiner to add those notes (say
before splitting remember highest pseudo number, after the splitter see if
we've added some new pseudos and by scanning the resulting sequence see if we
shouldn't add REG_DEAD notes for those somewhere, because they shouldn't be
used anywhere outside of the sequence.

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread lisyarus at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645

--- Comment #5 from Nikita Lisitsa  ---
Oh, thank you a lot! Indeed, this version compiles to just mulss & sqrtss

float test (float x)
{
float y = x*x;
if (std::isless(y, 0.f))
__builtin_unreachable();
return std::sqrt(y);
}

Yet, I still don't quite understand what is happening here. Is it because the
standard '<' operator is still subject to FE_* ?

Concerning pragmas, the code

#pragma GCC optimize ("no-math-errno")
float test (float x)
{
return std::sqrt(x*x);
}

produces the following assembly

std::sqrt(float):
pxorxmm2, xmm2
movaps  xmm1, xmm0
ucomiss xmm2, xmm0
sqrtss  xmm1, xmm1
ja  .L8
movaps  xmm0, xmm1
ret
.L8:
sub rsp, 24
movss   DWORD PTR [rsp+12], xmm1
callsqrtf
movss   xmm1, DWORD PTR [rsp+12]
add rsp, 24
movaps  xmm0, xmm1
ret
test(float):
mulss   xmm0, xmm0
jmp std::sqrt(float)

So, the only notable difference is that now 'std::sqrt(float)' is not inlined,
but is tail-called instead. Thus, the pragma seems not to work?

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645

--- Comment #6 from rguenther at suse dot de  ---
On Thu, 5 Sep 2019, lisyarus at gmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645
> 
> --- Comment #5 from Nikita Lisitsa  ---
> Oh, thank you a lot! Indeed, this version compiles to just mulss & sqrtss
> 
> float test (float x)
> {
> float y = x*x;
> if (std::isless(y, 0.f))
> __builtin_unreachable();
> return std::sqrt(y);
> }
> 
> Yet, I still don't quite understand what is happening here. Is it because the
> standard '<' operator is still subject to FE_* ?

It's probably because our jump-threading is imperfect if I interpret
Marcs comment correctly.  When seeing LE_EXPR we only consider

  if (FLOAT_TYPE_P (TREE_TYPE (op0)))
{
  build_and_record_new_cond (ORDERED_EXPR, op0, op1, p);
}

so we know it's ORDERED but we don't register it's known to be UNLE as 
well.

> Concerning pragmas, the code
> 
> #pragma GCC optimize ("no-math-errno")
> float test (float x)
> {
> return std::sqrt(x*x);
> }
> 
> produces the following assembly
> 
> std::sqrt(float):
> pxorxmm2, xmm2
> movaps  xmm1, xmm0
> ucomiss xmm2, xmm0
> sqrtss  xmm1, xmm1
> ja  .L8
> movaps  xmm0, xmm1
> ret
> .L8:
> sub rsp, 24
> movss   DWORD PTR [rsp+12], xmm1
> callsqrtf
> movss   xmm1, DWORD PTR [rsp+12]
> add rsp, 24
> movaps  xmm0, xmm1
> ret
> test(float):
> mulss   xmm0, xmm0
> jmp std::sqrt(float)
> 
> So, the only notable difference is that now 'std::sqrt(float)' is not inlined,
> but is tail-called instead. Thus, the pragma seems not to work?

True, there may already be a bug about this.  The issue is that
whether functions set errno or not is decided globally and this
info isn't changed between functions according to pragmas.

[Bug rtl-optimization/41396] missed space optimization related to basic block reorder

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41396

Richard Biener  changed:

   What|Removed |Added

  Component|middle-end  |rtl-optimization

--- Comment #4 from Richard Biener  ---
BB reordering is enabled at -Os now using the "simple" (non-STV) algorithm,
but for the testcase I don't see it's better now.

[Bug fortran/91668] New: Failure to deallocate ALLOCATABLE component of a type in a POINTER array of types on deallocation of POINTER array

2019-09-05 Thread c.s.brady at warwick dot ac.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91668

Bug ID: 91668
   Summary: Failure to deallocate ALLOCATABLE component of a type
in a POINTER array of types on deallocation of POINTER
array
   Product: gcc
   Version: 8.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: c.s.brady at warwick dot ac.uk
  Target Milestone: ---

A POINTER array of derived types having allocatable subcomponents does not
deallocate the subcomponents when the POINTER array is deallocated. If the
array of derived types is ALLOCATABLE rather than POINTER the deallocation of
the subcomponents occurs as expected. I believe that this behaviour is not
correct within the F2003 or newer standards. Testing the below code with
valgrind shows 4000 bytes definitely lost.

PROGRAM alloc_test

  TYPE :: subtype
INTEGER, DIMENSION(:), ALLOCATABLE :: alloc
  END TYPE subtype

  !Switching POINTER to ALLOCATABLE prevents the loss of memory
  TYPE(subtype), POINTER, DIMENSION(:) :: test

  ALLOCATE(test(10))
  DO i = 1, 10
ALLOCATE(test(i)%alloc(100))
  END DO

  DEALLOCATE(test)

END PROGRAM alloc_test

[Bug c++/91658] g++: internal compiler error: Killed (program cc1plus)

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91658

--- Comment #5 from Richard Biener  ---
Please attach preprocessed source, it's impossible to debug this with the
missing include file (and the files that file might include).

[Bug tree-optimization/91665] [8/9/10 Regression] ICE in build_vector_from_val, at tree.c:1904

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91665

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
I'll have a look.

[Bug c/91664] Undefined reference linker errors when static linking archive with gcc target_clones function multi-versioning

2019-09-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91664

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #8 from Martin Liška  ---
I'll take a look.

[Bug target/91474] Internal compiler error when building mabi=32 mips64-elf cross-compiler: segfault in parallel_settings.cc

2019-09-05 Thread joey.dumont at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91474

--- Comment #4 from Joey Dumont  ---
Created attachment 46831
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46831&action=edit
Preprocessed parallel_settings.cc

[Bug c/91669] New: #pragma's and _Pragma's work but _Pragma's used in an equivalent macro don't

2019-09-05 Thread pskocik at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91669

Bug ID: 91669
   Summary: #pragma's and _Pragma's work but _Pragma's used in an
equivalent macro don't
   Product: gcc
   Version: 5.5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pskocik at gmail dot com
  Target Milestone: ---

The problem appears to exist on all gcc versions.

Example Code:

#define BX_gcc_push(Category,...) BX_pragma(GCC Category push ) BX_pragma(GCC
Category __VA_ARGS__)
#define BX_gcc_pop(Category) BX_pragma(GCC Category pop)
#define BX_nodiag_push(DiagStr) BX_gcc_push(diagnostic, ignored DiagStr)
#define BX_nodiag_pop() BX_gcc_pop(diagnostic)
#define BX_pragma(...) _Pragma(#__VA_ARGS__)


int foo(void)
{

//This silences -Wreturn-type on the closing curly as it should
BX_nodiag_push("-Wreturn-type")
}
BX_nodiag_pop()



#define BX_retundef(Rbr) /*{{{*/ \
BX_nodiag_push("-Wreturn-type") \
Rbr \
BX_nodiag_pop()
/*}}}*/

int bar(void)
{
//This FAILS to silence -Wreturn on the closing curly
//(works on clang and the code obtained from text-expanding the macro (gcc -E)
//works on gcc too) 
BX_retundef(})

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

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82750
Bug 82750 depends on bug 81740, which changed state.

Bug 81740 Summary: [7 Regression] wrong code at -O3 in both 32-bit and 64-bit 
modes on x86_64-linux-gnu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81740

   What|Removed |Added

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

[Bug tree-optimization/81740] [7 Regression] wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81740

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.4.1
 Resolution|--- |FIXED
  Known to fail||7.4.0

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

[Bug middle-end/90501] [10 regression] ICE: address taken, but ADDRESSABLE bit not set

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90501

--- Comment #16 from Richard Biener  ---
Author: rguenth
Date: Thu Sep  5 11:02:43 2019
New Revision: 275401

URL: https://gcc.gnu.org/viewcvs?rev=275401&root=gcc&view=rev
Log:
2019-09-05  Richard Biener  

PR middle-end/90501
* tree-inline.c (declare_return_variable): Mark the return
slot as addressable after building an address of it.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-inline.c

[Bug middle-end/90501] [10 regression] ICE: address taken, but ADDRESSABLE bit not set

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90501

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug tree-optimization/91665] [8/9/10 Regression] ICE in build_vector_from_val, at tree.c:1904

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91665

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Ugh, this is a mess.
The problem is that because the reduction is done in short int (or could be
signed char), but the actual bumps in the corresponding unsigned type as
overflow is in that case well defined, analyze_scalar_evolution returns a
NOP_EXPR from an unsinged short chrec to short int, STRIP_NOPS (access_fn);
drops that and so
STMT_VINFO_LOOP_PHI_EVOLUTION_BASE_UNCHANGED and
STMT_VINFO_LOOP_PHI_EVOLUTION_PART are actually unsigned short.
I'm e.g. surprised that is_nonwrapping_integer_induction is happy about that,
it checks
if (TYPE_OVERFLOW_UNDEFINED (lhs_type))
and doesn't check
TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (base)).
Though, max_stmt_executions is 65535 and thus maybe ok.
In any case, it seems vectorizable_reduction as well as
vect_create_epilog_for_reduction aren't prepared to cope, even when I added a
hack to fold_convert induc_val to the type it wants to create, there is another
ICE about short vs. unsigned short type mismatch.

I can offer a quick patch to punt in this case:
--- gcc/tree-vect-loop.c.jj 2019-07-10 15:52:56.793588202 +0200
+++ gcc/tree-vect-loop.c2019-09-05 12:55:28.120545749 +0200
@@ -6656,10 +6656,12 @@ vectorizable_reduction (stmt_vec_info st
  gcc_assert (TREE_CODE (base) == INTEGER_CST
  && TREE_CODE (step) == INTEGER_CST);
  cond_reduc_val = NULL_TREE;
+ if (!types_compatible_p (TREE_TYPE (reduc_def), TREE_TYPE (base)))
+   ;
  /* Find a suitable value, for MAX_EXPR below base, for MIN_EXPR
 above base; punt if base is the minimum value of the type for
 MAX_EXPR or maximum value of the type for MIN_EXPR for now.  */
- if (tree_int_cst_sgn (step) == -1)
+ else if (tree_int_cst_sgn (step) == -1)
{
  cond_reduc_op_code = MIN_EXPR;
  if (tree_int_cst_sgn (base) == -1)
although I'm not really sure if reduc_def is the right type to compare to.
But not really sure what needs to be done to resolve this properly, guess we
need to perform the reduction increase in vector unsigned short type somehow.

[Bug c++/91658] g++: internal compiler error: Killed (program cc1plus)

2019-09-05 Thread ivan.chow2 at aecom dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91658

--- Comment #6 from Ivan Chow  ---
Thanks for helping out.

Please see attached file.

-Original Message-
From: rguenth at gcc dot gnu.org [mailto:gcc-bugzi...@gcc.gnu.org] 
Sent: Thursday, September 5, 2019 5:27 AM
To: Chow, Ivan (Aiken)
Subject: [Bug c++/91658] g++: internal compiler error: Killed (program cc1plus)

https://urldefense.proofpoint.com/v2/url?u=https-3A__gcc.gnu.org_bugzilla_show-5Fbug.cgi-3Fid-3D91658&d=DwIFaQ&c=TQzoP61-bYDBLzNd0XmHrw&r=1l2NCl9J2IRlx158OleV8UxhxKZcl07nghTppK8NHRQ&m=hPpUJ8SjyZ-_Gyee0DtgtqaQ-P6DJxXr9R7inMT8d9E&s=b-5JPjlduRkOaYl5cY6Q8Jjg-y_77tTYgI23-PWhkCI&e=
 

--- Comment #5 from Richard Biener  ---
Please attach preprocessed source, it's impossible to debug this with the
missing include file (and the files that file might include).

[Bug c++/91658] g++: internal compiler error: Killed (program cc1plus)

2019-09-05 Thread ivan.chow2 at aecom dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91658

--- Comment #7 from Ivan Chow  ---
Sorry.  I didn't know the limit of the size of the file in the email.

Please see attached file with gzip compressed.  

Thanks for helping out.


-Original Message-
From: gcc-bugzi...@gcc.gnu.org [mailto:gcc-bugzi...@gcc.gnu.org] 
Sent: Thursday, September 5, 2019 7:09 AM
To: Chow, Ivan (Aiken)
Subject: RE: [Bug c++/91658] g++: internal compiler error: Killed (program
cc1plus)

The file you are trying to attach is 5493 kilobytes (KB) in size. Attachments
cannot be more than 1000 KB. We recommend that you compress your attachment,
e.g. using gzip, bzip2 or xz. See also the guide to testcase reduction for more
hints. Alternately, if your attachment is an image, you could convert it to a
compressible format like JPG or PNG and try again. 

Chow, Ivan wrote:
> 
> Thanks for helping out.
> 
> Please see attached file.
> 
> -Original Message-
> From: rguenth at gcc dot gnu.org [mailto:gcc-bugzi...@gcc.gnu.org] 
> Sent: Thursday, September 5, 2019 5:27 AM
> To: Chow, Ivan (Aiken)
> Subject: [Bug c++/91658] g++: internal compiler error: Killed (program 
> cc1plus)
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__gcc.gnu.org_bugzilla_show-5Fbug.cgi-3Fid-3D91658&d=DwIFaQ&c=TQzoP61-bYDBLzNd0XmHrw&r=1l2NCl9J2IRlx158OleV8UxhxKZcl07nghTppK8NHRQ&m=hPpUJ8SjyZ-_Gyee0DtgtqaQ-P6DJxXr9R7inMT8d9E&s=b-5JPjlduRkOaYl5cY6Q8Jjg-y_77tTYgI23-PWhkCI&e=
>  
> 
> --- Comment #5 from Richard Biener  ---
> Please attach preprocessed source, it's impossible to debug this with the
> missing include file (and the files that file might include).

[Bug preprocessor/91639] [10 Regression] FAIL: gcc.dg/plugin/location-overflow-test-pr83173.c -fplugin=./location_overflo w_plugin.so scan-file-not # (?!1 [^\r\n]+location-overflow-test-pr83173-1.h"

2019-09-05 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91639

Nathan Sidwell  changed:

   What|Removed |Added

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

--- Comment #2 from Nathan Sidwell  ---
Fixed r275402

[Bug preprocessor/91639] [10 Regression] FAIL: gcc.dg/plugin/location-overflow-test-pr83173.c -fplugin=./location_overflo w_plugin.so scan-file-not # (?!1 [^\r\n]+location-overflow-test-pr83173-1.h"

2019-09-05 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91639

--- Comment #3 from Nathan Sidwell  ---
Author: nathan
Date: Thu Sep  5 11:23:48 2019
New Revision: 275402

URL: https://gcc.gnu.org/viewcvs?rev=275402&root=gcc&view=rev
Log:
[preprocessor/91639] #includes at EOF

https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00280.html
libcpp/
PR preprocessor/91639
* directives.c (do_include_common): Tell lexer we're a #include.
* files.c (_cpp_stack_file): Lexer will have always incremented.
* internal.h (struct cpp_context): Extend in_directive's
semantics.
* lex.c (_cpp_lex_direct): Increment line for final \n when lexing
for an ISO #include.
* line-map.c (linemap_line_start): Remember if we overflowed.

gcc/testsuite/
PR preprocessor/91639
* c-c++-common/cpp/pr91639.c: New.
* c-c++-common/cpp/pr91639-one.h: New.
* c-c++-common/cpp/pr91639-two.h: New.

Added:
trunk/gcc/testsuite/c-c++-common/cpp/pr91639-one.h
trunk/gcc/testsuite/c-c++-common/cpp/pr91639-two.h
trunk/gcc/testsuite/c-c++-common/cpp/pr91639.c
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libcpp/ChangeLog
trunk/libcpp/directives.c
trunk/libcpp/files.c
trunk/libcpp/internal.h
trunk/libcpp/lex.c
trunk/libcpp/line-map.c

[Bug tree-optimization/91665] [8/9/10 Regression] ICE in build_vector_from_val, at tree.c:1904

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91665

--- Comment #4 from Richard Biener  ---
int val[1024];
void
foo (int n)
{
  int i;
  for (int j = 0, i = n; j < 1024; ++j, i=(unsigned)i+1)
val[j] = i;
}

generates signed add for the induction vectorization.

[Bug tree-optimization/91665] [8/9/10 Regression] ICE in build_vector_from_val, at tree.c:1904

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91665

--- Comment #5 from Richard Biener  ---
(In reply to Richard Biener from comment #4)
> int val[1024];
> void
> foo (int n)
> {
>   int i;
>   for (int j = 0, i = n; j < 1024; ++j, i=(unsigned)i+1)
> val[j] = i;
> }
> 
> generates signed add for the induction vectorization.

And the problematic part is likely not the vector code but the init vector
compute which uses signed values as well:

   [local count: 10737418]:
  _12 = n_6(D) + 1;
  _11 = n_6(D) + 2;
  _5 = n_6(D) + 3;
  _4 = {n_6(D), _12, _11, _5};
  vect_cst__3 = { 4, 4, 4, 4 };

fortunately we don't (yet) derive ranges for n_6(D) after the adds otherwise
we'd miscompile, say

int val[1024];
void
foo (int n)
{
  int i;
  for (int j = 0, i = n; j < 1024; ++j, i=(unsigned)i+1)
val[j] = i;
  if (n == __INT_MAX__)
return;
  __builtin_abort ();
}

during late VRP.

[Bug target/91615] [10 regression][armeb] ICEs since r274986

2019-09-05 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91615

--- Comment #7 from Christophe Lyon  ---
(In reply to Bernd Edlinger from comment #6)
> Created attachment 46820 [details]
> untested patch

This patch fixes the armeb problems reported here, thanks!

(in addition to the scan-assembler-times issues on unaligned-memcpy-[23].c)

[Bug tree-optimization/90328] [7 Regression] Wrong loop distribution with aliasing

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90328

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.4.1
 Resolution|--- |FIXED
  Known to fail||7.4.0

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

[Bug middle-end/49774] [meta-bug] restrict qualification aliasing issues

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49774
Bug 49774 depends on bug 90328, which changed state.

Bug 90328 Summary: [7 Regression] Wrong loop distribution with aliasing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90328

   What|Removed |Added

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

[Bug target/89578] [9 Regression] 5% runtime regression for 481.wrf at -Ofast -flto

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89578

--- Comment #10 from Richard Biener  ---
Author: rguenth
Date: Thu Sep  5 12:11:52 2019
New Revision: 275405

URL: https://gcc.gnu.org/viewcvs?rev=275405&root=gcc&view=rev
Log:
2019-09-05  Richard Biener  

* lto-streamer.h (LTO_minor_version): Bump.

Backport from mainline
2019-05-06  Richard Biener  

PR tree-optimization/90328
* tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest.
* tree-data-ref.c (dr_may_alias_p): Check whether the clique
is valid in the loop nest before using it.
(initialize_data_dependence_relation): Adjust.
* graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing
loop as loop-nest to dr_may_alias_p.

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

2019-03-08  Richard Biener  

PR middle-end/89578
* cfgloop.h (struct loop): Add owned_clique field.
* cfgloopmanip.c (copy_loop_info): Copy it.
* tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique
cliques.
* tree-inline.c (copy_loops): Remap owned_clique.
* lto-streamer-in.c (input_cfg): Stream owned_clique.
* lto-streamer-out.c (output_cfg): Likewise.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques.

2019-02-22  Richard Biener  

PR middle-end/87609
* cfghooks.h (dependence_hash): New typedef.
(struct copy_bb_data): New type.
(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
(duplicate_block): Likewise.
* cfghooks.c (duplicate_block): Pass down copy_bb_data.
(copy_bbs): Create and pass down copy_bb_data.
* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
(rtl_duplicate_bb): Likewise.
* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
remap dependence info.

* gcc.dg/torture/restrict-7.c: New testcase.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-core.h (tree_base): Document special clique values.
* tree-inline.c (remap_dependence_clique): Do not use the
special clique value of one.
(maybe_set_dependence_info): Use clique one.
(clear_dependence_clique): New callback.
(compute_dependence_clique): Clear clique one from all refs
before assigning it (again).

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr90328.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/restrict-7.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/cfghooks.c
branches/gcc-7-branch/gcc/cfghooks.h
branches/gcc-7-branch/gcc/cfgloop.h
branches/gcc-7-branch/gcc/cfgloopmanip.c
branches/gcc-7-branch/gcc/cfgrtl.c
branches/gcc-7-branch/gcc/graphite-scop-detection.c
branches/gcc-7-branch/gcc/lto-streamer-in.c
branches/gcc-7-branch/gcc/lto-streamer-out.c
branches/gcc-7-branch/gcc/lto-streamer.h
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-cfg.c
branches/gcc-7-branch/gcc/tree-core.h
branches/gcc-7-branch/gcc/tree-data-ref.c
branches/gcc-7-branch/gcc/tree-data-ref.h
branches/gcc-7-branch/gcc/tree-inline.c
branches/gcc-7-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/90328] [7 Regression] Wrong loop distribution with aliasing

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90328

--- Comment #11 from Richard Biener  ---
Author: rguenth
Date: Thu Sep  5 12:11:52 2019
New Revision: 275405

URL: https://gcc.gnu.org/viewcvs?rev=275405&root=gcc&view=rev
Log:
2019-09-05  Richard Biener  

* lto-streamer.h (LTO_minor_version): Bump.

Backport from mainline
2019-05-06  Richard Biener  

PR tree-optimization/90328
* tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest.
* tree-data-ref.c (dr_may_alias_p): Check whether the clique
is valid in the loop nest before using it.
(initialize_data_dependence_relation): Adjust.
* graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing
loop as loop-nest to dr_may_alias_p.

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

2019-03-08  Richard Biener  

PR middle-end/89578
* cfgloop.h (struct loop): Add owned_clique field.
* cfgloopmanip.c (copy_loop_info): Copy it.
* tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique
cliques.
* tree-inline.c (copy_loops): Remap owned_clique.
* lto-streamer-in.c (input_cfg): Stream owned_clique.
* lto-streamer-out.c (output_cfg): Likewise.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques.

2019-02-22  Richard Biener  

PR middle-end/87609
* cfghooks.h (dependence_hash): New typedef.
(struct copy_bb_data): New type.
(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
(duplicate_block): Likewise.
* cfghooks.c (duplicate_block): Pass down copy_bb_data.
(copy_bbs): Create and pass down copy_bb_data.
* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
(rtl_duplicate_bb): Likewise.
* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
remap dependence info.

* gcc.dg/torture/restrict-7.c: New testcase.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-core.h (tree_base): Document special clique values.
* tree-inline.c (remap_dependence_clique): Do not use the
special clique value of one.
(maybe_set_dependence_info): Use clique one.
(clear_dependence_clique): New callback.
(compute_dependence_clique): Clear clique one from all refs
before assigning it (again).

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr90328.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/restrict-7.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/cfghooks.c
branches/gcc-7-branch/gcc/cfghooks.h
branches/gcc-7-branch/gcc/cfgloop.h
branches/gcc-7-branch/gcc/cfgloopmanip.c
branches/gcc-7-branch/gcc/cfgrtl.c
branches/gcc-7-branch/gcc/graphite-scop-detection.c
branches/gcc-7-branch/gcc/lto-streamer-in.c
branches/gcc-7-branch/gcc/lto-streamer-out.c
branches/gcc-7-branch/gcc/lto-streamer.h
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-cfg.c
branches/gcc-7-branch/gcc/tree-core.h
branches/gcc-7-branch/gcc/tree-data-ref.c
branches/gcc-7-branch/gcc/tree-data-ref.h
branches/gcc-7-branch/gcc/tree-inline.c
branches/gcc-7-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/87609] [7 Regression] miscompilation with restrict and loop

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87609

--- Comment #14 from Richard Biener  ---
Author: rguenth
Date: Thu Sep  5 12:11:52 2019
New Revision: 275405

URL: https://gcc.gnu.org/viewcvs?rev=275405&root=gcc&view=rev
Log:
2019-09-05  Richard Biener  

* lto-streamer.h (LTO_minor_version): Bump.

Backport from mainline
2019-05-06  Richard Biener  

PR tree-optimization/90328
* tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest.
* tree-data-ref.c (dr_may_alias_p): Check whether the clique
is valid in the loop nest before using it.
(initialize_data_dependence_relation): Adjust.
* graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing
loop as loop-nest to dr_may_alias_p.

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

2019-03-08  Richard Biener  

PR middle-end/89578
* cfgloop.h (struct loop): Add owned_clique field.
* cfgloopmanip.c (copy_loop_info): Copy it.
* tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique
cliques.
* tree-inline.c (copy_loops): Remap owned_clique.
* lto-streamer-in.c (input_cfg): Stream owned_clique.
* lto-streamer-out.c (output_cfg): Likewise.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques.

2019-02-22  Richard Biener  

PR middle-end/87609
* cfghooks.h (dependence_hash): New typedef.
(struct copy_bb_data): New type.
(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
(duplicate_block): Likewise.
* cfghooks.c (duplicate_block): Pass down copy_bb_data.
(copy_bbs): Create and pass down copy_bb_data.
* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
(rtl_duplicate_bb): Likewise.
* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
remap dependence info.

* gcc.dg/torture/restrict-7.c: New testcase.

2019-02-22  Richard Biener  

PR tree-optimization/87609
* tree-core.h (tree_base): Document special clique values.
* tree-inline.c (remap_dependence_clique): Do not use the
special clique value of one.
(maybe_set_dependence_info): Use clique one.
(clear_dependence_clique): New callback.
(compute_dependence_clique): Clear clique one from all refs
before assigning it (again).

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr90328.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/restrict-7.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/cfghooks.c
branches/gcc-7-branch/gcc/cfghooks.h
branches/gcc-7-branch/gcc/cfgloop.h
branches/gcc-7-branch/gcc/cfgloopmanip.c
branches/gcc-7-branch/gcc/cfgrtl.c
branches/gcc-7-branch/gcc/graphite-scop-detection.c
branches/gcc-7-branch/gcc/lto-streamer-in.c
branches/gcc-7-branch/gcc/lto-streamer-out.c
branches/gcc-7-branch/gcc/lto-streamer.h
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-cfg.c
branches/gcc-7-branch/gcc/tree-core.h
branches/gcc-7-branch/gcc/tree-data-ref.c
branches/gcc-7-branch/gcc/tree-data-ref.h
branches/gcc-7-branch/gcc/tree-inline.c
branches/gcc-7-branch/gcc/tree-ssa-structalias.c

[Bug tree-optimization/87609] [7 Regression] miscompilation with restrict and loop

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87609

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.4.1
 Resolution|--- |FIXED
  Known to fail||7.4.0

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

[Bug tree-optimization/90328] [7 Regression] Wrong loop distribution with aliasing

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90328
Bug 90328 depends on bug 87609, which changed state.

Bug 87609 Summary: [7 Regression] miscompilation with restrict and loop
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87609

   What|Removed |Added

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

[Bug rtl-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug rtl-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

Richard Biener  changed:

   What|Removed |Added

 CC||seurer at gcc dot gnu.org
 CC||kargl at gcc dot gnu.org

--- Comment #7 from Richard Biener  ---
*** Bug 91657 has been marked as a duplicate of this bug. ***

--- Comment #8 from Richard Biener  ---
*** Bug 91659 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

Richard Biener  changed:

   What|Removed |Added

 CC||seurer at gcc dot gnu.org
 CC||kargl at gcc dot gnu.org

--- Comment #7 from Richard Biener  ---
*** Bug 91657 has been marked as a duplicate of this bug. ***

--- Comment #8 from Richard Biener  ---
*** Bug 91659 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Thu Sep  5 13:23:28 2019
New Revision: 275406

URL: https://gcc.gnu.org/viewcvs?rev=275406&root=gcc&view=rev
Log:
2019-09-05  Richard Biener  

PR rtl-optimization/91656
* postreload-gcse.c (record_last_mem_set_info): Revert addition
of early out.

* gcc.dg/torture/pr91656-1.c: New testcase.
* gcc.dg/torture/pr91656-2.c: Likewise.
* gcc.dg/torture/pr91656-3.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr91656-1.c
trunk/gcc/testsuite/gcc.dg/torture/pr91656-2.c
trunk/gcc/testsuite/gcc.dg/torture/pr91656-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/postreload-gcse.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/91657] [10 regression] many failures after r275365

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91657

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Richard Biener  ---
Dup (hopefully).

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

[Bug rtl-optimization/91659] [10 Regression] Revision 275365 is causing a Fortran testsuite failure at -O3

2019-09-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91659

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Richard Biener  ---
Dup (hopefully).

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

[Bug middle-end/91001] internal compiler error: in extract_insn, at recog.c:2310

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91001

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Thu Sep  5 13:30:23 2019
New Revision: 275408

URL: https://gcc.gnu.org/viewcvs?rev=275408&root=gcc&view=rev
Log:
PR middle-end/91001
PR middle-end/91105
PR middle-end/91106
* calls.c (load_register_parameters): For TYPE_TRANSPARENT_AGGR
types, use type of their first field instead of type of
args[i].tree_value.

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

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr91001.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/testsuite/ChangeLog

[Bug target/91106] internal compiler error: output_operand: invalid use of register 'frame'

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91106

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Thu Sep  5 13:30:23 2019
New Revision: 275408

URL: https://gcc.gnu.org/viewcvs?rev=275408&root=gcc&view=rev
Log:
PR middle-end/91001
PR middle-end/91105
PR middle-end/91106
* calls.c (load_register_parameters): For TYPE_TRANSPARENT_AGGR
types, use type of their first field instead of type of
args[i].tree_value.

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

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr91001.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/91105] internal compiler error: maximum number of generated reload insns per insn achieved (90)

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91105

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Thu Sep  5 13:30:23 2019
New Revision: 275408

URL: https://gcc.gnu.org/viewcvs?rev=275408&root=gcc&view=rev
Log:
PR middle-end/91001
PR middle-end/91105
PR middle-end/91106
* calls.c (load_register_parameters): For TYPE_TRANSPARENT_AGGR
types, use type of their first field instead of type of
args[i].tree_value.

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

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr91001.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/testsuite/ChangeLog

[Bug target/91615] [10 regression][armeb] ICEs since r274986

2019-09-05 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91615

--- Comment #8 from Bernd Edlinger  ---
Author: edlinger
Date: Thu Sep  5 13:40:17 2019
New Revision: 275409

URL: https://gcc.gnu.org/viewcvs?rev=275409&root=gcc&view=rev
Log:
2019-09-05  Bernd Edlinger  

PR middle-end/91615
* expr.c (expand_expr_real_1): Handle misaligned TARGET_MEM_REF
without movmisalign optab.

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

[Bug middle-end/91001] internal compiler error: in extract_insn, at recog.c:2310

2019-09-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91001

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

[Bug libstdc++/79700] std::fabsf and std::fabsl missing from

2019-09-05 Thread jmb_tux at gmx dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700

JMB  changed:

   What|Removed |Added

 CC||jmb_tux at gmx dot net

--- Comment #3 from JMB  ---
The bug is still present with g++ 8.3.0 on Ubuntu 19.04
(g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0) as tested with sqrtl.
As g++ is not conformant with c++11 (AFAIK):
  std::sqrt(n)
will result in the error message:
  error: ‘sqrtl’ is not a member of ‘std’
while using '# include ',
this bug should be fixed.
Otherwise please give a short comment to this bug report explaining why this
can  not or should not be fixed.
Especially if giving C++14 as default ...

[Bug go/91035] [10 Regression] gotools fails to build on s390x-linux-gnu

2019-09-05 Thread krebbel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91035

Andreas Krebbel  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-09-05
 Ever confirmed|0   |1

--- Comment #6 from Andreas Krebbel  ---
Bisect indicates that the problem might be related to that change:

Author: ian
Date: Thu May 30 17:26:46 2019
New Revision: 271784

URL: https://gcc.gnu.org/viewcvs?rev=271784&root=gcc&view=rev
Log:
compiler: intrinsify sync/atomic functions

Let the Go frontend recognize sync/atomic functions and turn them
into intrinsics.

Also make sure not to intrinsify calls in go or defer statements.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/178937

Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/expressions.cc
trunk/gcc/go/gofrontend/statements.cc

[Bug testsuite/91670] New: [10 regression] g++.dg/ubsan/pr59415.C fails starting with rr275388

2019-09-05 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91670

Bug ID: 91670
   Summary: [10 regression] g++.dg/ubsan/pr59415.C  fails starting
with rr275388
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

Did updating a test case for this change get missed?

Executing on host:
/home/seurer/gcc/build/gcc-test2/gcc/testsuite/g++/../../xg++
-B/home/seurer/gcc/build/gcc-test2/gcc/testsuite/g++/../../
/home/seurer/gcc/gcc-test2/gcc/testsuite/g++.dg/ubsan/pr59415.C   
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never  -nostdinc++
-I/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/libstdc++-v3/include/powerpc64-unknown-linux-gnu
-I/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/libstdc++-v3/include
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/libsupc++
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/include/backward
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/testsuite/util -fmessage-length=0  
-O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -fsanitize=null -Wall
-fvtable-verify=std  -S -o pr59415.s(timeout = 300)
spawn -ignore SIGHUP
/home/seurer/gcc/build/gcc-test2/gcc/testsuite/g++/../../xg++
-B/home/seurer/gcc/build/gcc-test2/gcc/testsuite/g++/../../
/home/seurer/gcc/gcc-test2/gcc/testsuite/g++.dg/ubsan/pr59415.C
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -nostdinc++
-I/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/libstdc++-v3/include/powerpc64-unknown-linux-gnu
-I/home/seurer/gcc/build/gcc-test2/powerpc64-unknown-linux-gnu/libstdc++-v3/include
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/libsupc++
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/include/backward
-I/home/seurer/gcc/gcc-test2/libstdc++-v3/testsuite/util -fmessage-length=0 -O2
-flto -fuse-linker-plugin -fno-fat-lto-objects -fsanitize=null -Wall
-fvtable-verify=std -S -o pr59415.s
cc1plus: sorry, unimplemented: vtable verification is not supported with LTO
compiler exited with status 1
FAIL: g++.dg/ubsan/pr59415.C   -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects  (test for excess errors)
Excess errors:
cc1plus: sorry, unimplemented: vtable verification is not supported with LTO

[Bug fortran/91671] New: [10 Regression] gfortran.dg/direct_io_10.f fails at runtime with -O3

2019-09-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91671

Bug ID: 91671
   Summary: [10 Regression] gfortran.dg/direct_io_10.f fails at
runtime with -O3
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: janus at gcc dot gnu.org
  Target Milestone: ---

Running the gfortran testsuite on today's trunk I see:

FAIL: gfortran.dg/direct_io_10.f   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/direct_io_10.f   -O3 -g  execution test

In particular the test case seems to fail with -O3, but not with -O2:

$ gfortran-10 -O3 direct_io_10.f 
$ ./a.out 
STOP 3
$ gfortran-10 -O2 direct_io_10.f 
$ ./a.out 
$ 

This is on Ubuntu 19.04 (x86_64) and my configure line includes
"--with-arch=haswell".

[Bug libstdc++/79700] std::fabsf and std::fabsl missing from

2019-09-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79700

--- Comment #4 from Jonathan Wakely  ---
(In reply to JMB from comment #3)
> this bug should be fixed.

Yes, we know. That's why there's a bug report.

> Otherwise please give a short comment to this bug report explaining why this
> can  not or should not be fixed.

Of course it should be fixed, that's why there's a bug report and it hasn't
been closed. But we have lots of bugs and finite resources.

> Especially if giving C++14 as default ...

As I said above, it's not actually clear if this is required by C++11 and
C++14. The function sqrtl is not mentioned at all in the C++14 standard. It's
definitely required by C++17, but that isn't enabled by default.

[Bug testsuite/91670] [10 regression] g++.dg/ubsan/pr59415.C fails starting with rr275388

2019-09-05 Thread ctice at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91670

ctice at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ctice at gcc dot gnu.org

--- Comment #1 from ctice at gcc dot gnu.org ---
Yes, sorry, I missed that.  I will try to fix asap.

[Bug c/91669] #pragma's and _Pragma's work but _Pragma's used in an equivalent macro don't

2019-09-05 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91669

Eric Gallager  changed:

   What|Removed |Added

   Keywords||diagnostic
 CC||egallager at gcc dot gnu.org
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=90400,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=69558,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=91285

--- Comment #1 from Eric Gallager  ---
I think there's other bugs open similar to this one, e.g. bug 90400, bug 69558,
bug 91285, etc.

[Bug fortran/91671] [10 Regression] gfortran.dg/direct_io_10.f fails at runtime with -O3

2019-09-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91671

janus at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords||wrong-code
   Target Milestone|--- |10.0

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
> This is on Ubuntu 19.04 (x86_64) and my configure line includes
> "--with-arch=haswell".

However, the problem does not seem to be Haswell-specific, i.e. it does not go
away when removing the flag --with-arch=haswell.

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Thu Sep  5 15:37:52 2019
New Revision: 275421

URL: https://gcc.gnu.org/viewcvs?rev=275421&root=gcc&view=rev
Log:
PR c++/91644 - ICE with constinit in function template.
* decl.c (start_decl): Call retrofit_lang_decl for constinit variables.
* pt.c (tsubst_expr): Pass LOOKUP_CONSTINIT down to cp_finish_decl for
constinit variables.

* g++.dg/cpp2a/constinit13.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp2a/constinit13.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/91644] [C++20] constinit segfaults inside templated functions

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91644

Marek Polacek  changed:

   What|Removed |Added

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

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

[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts

2019-09-05 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635

--- Comment #22 from Jim Wilson  ---
> First of all, I think you need to use :DI instead of :GPR for the last
> define_split, as it shouldn't be iterated with.

Yes, sloppy copy paste.  I will fix before committing.

> Second, doesn't this mean that the splitters will be matched then only
> during combine and never afterwards?

The define_splits were specifically written to match patterns created by
combine that aren't valid instructions.  So I think it is OK if they can only
be matched during combine.  My empirical results are good looking at libc and
libstdc++ code size, I haven't seen any cases where I get worse code size by
modifying them to use clobbers.

> The can_create_pseudo_p () -> gen_reg_rtx (mode) way of adding intermediate
> temporaries is used heavily in many other backends, just look at say i386,
> rs6000 or aarch64 backends for examples (I've looked only at those 3 and
> found many spots in each), so if missing REG_DEAD notes affect code quality,
> perhaps it would be more useful to try to change the combiner to add those
> notes (say before splitting remember highest pseudo number, after the
> splitter see if we've added some new pseudos and by scanning the resulting
> sequence see if we shouldn't add REG_DEAD notes for those somewhere, because
> they shouldn't be used anywhere outside of the sequence.

Yes, long term, I think it would be a good idea to improve combine to add
REG_DEAD notes for temporary regs created by splitters.  I don't plan to work
on that as I have too much other stuff to do.  I'd be willing to create a bug
report if you want me to.

[Bug middle-end/91605] [10 Regression] ICE in ix86_avx256_split_vector_move_misalign, at config/i386/i386-expand.c:489 since r274986

2019-09-05 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91605

Arseny Solokha  changed:

   What|Removed |Added

 CC||asolokha at gmx dot com

--- Comment #4 from Arseny Solokha  ---
Should this PR be closed now?

[Bug middle-end/91605] [10 Regression] ICE in ix86_avx256_split_vector_move_misalign, at config/i386/i386-expand.c:489 since r274986

2019-09-05 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91605

--- Comment #5 from Bernd Edlinger  ---
Yes, fixed.

[Bug middle-end/91605] [10 Regression] ICE in ix86_avx256_split_vector_move_misalign, at config/i386/i386-expand.c:489 since r274986

2019-09-05 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91605

Bernd Edlinger  changed:

   What|Removed |Added

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

--- Comment #6 from Bernd Edlinger  ---
closing...

[Bug c++/67825] [concepts] expression constraint bug when taking address of a member function

2019-09-05 Thread andrew.n.sutton at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67825

Andrew Sutton  changed:

   What|Removed |Added

 CC||andrew.n.sutton at gmail dot 
com

--- Comment #1 from Andrew Sutton  ---
Created attachment 46833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46833&action=edit
Patch against concepts-cxx2a to add test (git format-patch format)

This appears to have been fixed in concepts-cxx2a. Patch adds a test for the
PR.

[Bug c++/67860] [concepts] bug with overloaded, refined function with explicit and variadic template arguments

2019-09-05 Thread andrew.n.sutton at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67860

Andrew Sutton  changed:

   What|Removed |Added

 CC||andrew.n.sutton at gmail dot 
com

--- Comment #2 from Andrew Sutton  ---
Created attachment 46834
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46834&action=edit
Patch against concepts-cxx2a to add test (git format-patch format)

This appears to have been resolved concepts-cxx2a. Patch adds a test for the
PR.

[Bug c/91672] New: wrong amount of storage allocated for initialized structs with flexible array members

2019-09-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91672

Bug ID: 91672
   Summary: wrong amount of storage allocated for initialized
structs with flexible array members
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Even though GCC takes advantage of tail padding when laying out structures with
flexible array members, in C mode it allocates excess storage for statically
initialized objects of such structs.

In the test case below, thanks to tail padding, sizeof (struct A) is
sufficiently large to store each of a0 through a3.  But as the assembly output
shows, the variables occupy more storage than necessary.

$ cat a.c && gcc -O2 -S -Wall -Wextra -o /dev/stdout -xc a.c | grep -e \.size
struct A
{
  __INT64_TYPE__ i64;
  __INT16_TYPE__ i16;
  __INT16_TYPE__ a16[];
};

struct A a0 = { 0, 1 };
struct A a1 = { 1, 1, { 1 } };
struct A a2 = { 2, 1, { 1, 2 } };
struct A a3 = { 3, 1, { 1, 2, 3 } };
struct A a4 = { 4, 1, { 1, 2, 3, 4 } };
.size   a4, 24
.size   a3, 22
.size   a2, 20
.size   a1, 18
.size   a0, 16

G++ on the other hand, allocates the same amount of space regardless of the
size of the initializer:

$ gcc -O2 -S -Wall -Wextra -o /dev/stdout -xc++ a.c | grep -e \.size
.size   a4, 16
.size   a3, 16
.size   a2, 16
.size   a1, 16
.size   a0, 16

Clang allocates just the right amount, i.e., 16 bytes for a0 through a3 and 24
bytes for a4.

[Bug c++/91673] New: GCC ICE when partially specialising class template on a function-signature type with deduced noexcept qualifier

2019-09-05 Thread lewissbaker.opensource at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91673

Bug ID: 91673
   Summary: GCC ICE when partially specialising class template on
a function-signature type with deduced noexcept
qualifier
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lewissbaker.opensource at gmail dot com
  Target Milestone: ---

See https://godbolt.org/z/BndP6r

Version: GCC trunk
Command-line: -std=c++1z

Compiling the following code:
```
template
struct overload;

template
struct overload {
using signature_t = Ret(Args...) noexcept(NoExcept);
};

overload x;
```

results in the following output:
```
: In instantiation of 'struct overload':
:9:18:   required from here
:6:11: internal compiler error: in tsubst_copy, at cp/pt.c:16183
6 | using signature_t = Ret(Args...) noexcept(NoExcept);
  |   ^~~
```

This seemed to compile without error under earlier releases of GCC.

[Bug c++/91673] [10 Regression] GCC ICE when partially specialising class template on a function-signature type with deduced noexcept qualifier

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91673

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Keywords||ice-on-valid-code
   Last reconfirmed||2019-09-05
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1
Summary|GCC ICE when partially  |[10 Regression] GCC ICE
   |specialising class template |when partially specialising
   |on a function-signature |class template on a
   |type with deduced noexcept  |function-signature type
   |qualifier   |with deduced noexcept
   ||qualifier
   Target Milestone|--- |10.0

--- Comment #1 from Marek Polacek  ---
Started with r272586 so mine.

[Bug target/86393] GCC-8 appears to not detect AVX512 on iMac Pro 2018

2019-09-05 Thread mrslevinsky at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86393

--- Comment #12 from Mikael Slevinsky  ---
It is fixed for all GCC versions I checked: all the up-to-date versions of 4.9,
5, 6, 7, 8, 9 from Homebrew.

Also, I recently updated from High Sierra to Mojave, and the new clang is:

scima-mh421-20:FastTransforms mikael$ clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

(In reply to Iain Sandoe from comment #11)
> (In reply to Mikael Slevinsky from comment #10)
> > I can confirm this is fixed, thank you!
> 
> Great, for which GCC versions is it fixed?
> 
> > P.S. the exact processor type is a Xeon(R) W-2191B CPU @ 2.30GHz.
> 
> thanks

[Bug middle-end/91674] New: [ARM/thumb] redundant memcpy does not get optimized away on thumb

2019-09-05 Thread andij.cr at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91674

Bug ID: 91674
   Summary: [ARM/thumb] redundant memcpy does not get optimized
away on thumb
   Product: gcc
   Version: 8.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andij.cr at gmail dot com
  Target Milestone: ---

consider this c++ function

#include 
#include 
#include 
auto to_bytes(uint32_t arg){
std::array out{};
std::memcpy(out.data(), &arg, sizeof(arg));
return out;
}

on a little endian arch this function could be no-op. 
compiled with g++ -Os we get:
to_bytes(unsigned int):
mov eax, edi
ret 

on arm this somewhat works:
compiled with arm-none-eabi-g++ -Os
to_bytes(unsigned int):
sub sp, sp, #8
add sp, sp, #8
bx  lr

notice the redundant sub followed by an add

but if if thumb is forced, the full optimization is not performed
compiled with arm-none-eabi-g++ -Os -march=armv7-m -mtune=cortex-m3
to_bytes(unsigned int):
mov r3, r0
movsr0, #0
uxtbr2, r3
bfi r0, r2, #0, #8
ubfxr2, r3, #8, #8
bfi r0, r2, #8, #8
ubfxr2, r3, #16, #8
bfi r0, r2, #16, #8
lsrsr3, r3, #24
sub sp, sp, #8
bfi r0, r3, #24, #8
add sp, sp, #8
bx  lr

in contrast, cross compiling with clang7 produces the desired optimization:
compiled with clang++7 --target=arm-none-eabi -march=armv7-m -mtune=cortex-m3
to_bytes(unsigned int):
bx  lr

notice also how there is no redundant stack pointer manipulation

[Bug libstdc++/91675] New: Memory corruption with std::function

2019-09-05 Thread mika.fischer at kit dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91675

Bug ID: 91675
   Summary: Memory corruption with std::function
   Product: gcc
   Version: 9.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mika.fischer at kit dot edu
  Target Milestone: ---

Created attachment 46835
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46835&action=edit
Test case actually causing a SEGFAULT

The following minimal example leads to valgrind errors with GCC 9.1 and 9.2

I've also attached a longer example which reliably triggers a SEGFAULT for me.


#include 

// Make this non-trivially-copyable so that std::function must put it on the
heap
struct lambda {
lambda() {}
lambda(const lambda&) {}
void operator()() const {}
};

// Ternary expression with throw is needed to trigger the issue
std::function safe_make_function(std::function f) {
return f ? f : throw 1;
}

int main() {
safe_make_function(lambda{});
}


Valgrind output:

==10264== Invalid free() / delete / delete[] / realloc()
==10264==at 0x483A08B: operator delete(void*, unsigned long)
(vg_replace_malloc.c:585)
==10264==by 0x407B1D:
std::_Function_base::_Base_manager::_M_destroy(std::_Any_data&,
std::integral_constant) (std_function.h:191)
==10264==by 0x4079EB:
std::_Function_base::_Base_manager::_M_manager(std::_Any_data&,
std::_Any_data const&, std::_Manager_operation) (std_function.h:215)
==10264==by 0x4077EA: std::_Function_base::~_Function_base()
(std_function.h:260)
==10264==by 0x407845: std::function::~function()
(std_function.h:373)
==10264==by 0x407757: main (minimal.cpp:16)
==10264==  Address 0x4bb1c80 is 0 bytes inside a block of size 1 free'd
==10264==at 0x483A08B: operator delete(void*, unsigned long)
(vg_replace_malloc.c:585)
==10264==by 0x407B1D:
std::_Function_base::_Base_manager::_M_destroy(std::_Any_data&,
std::integral_constant) (std_function.h:191)
==10264==by 0x4079EB:
std::_Function_base::_Base_manager::_M_manager(std::_Any_data&,
std::_Any_data const&, std::_Manager_operation) (std_function.h:215)
==10264==by 0x4077EA: std::_Function_base::~_Function_base()
(std_function.h:260)
==10264==by 0x407845: std::function::~function()
(std_function.h:373)
==10264==by 0x40774B: main (minimal.cpp:16)
==10264==  Block was alloc'd at
==10264==at 0x4838DEF: operator new(unsigned long)
(vg_replace_malloc.c:334)
==10264==by 0x407A24:
std::_Function_base::_Base_manager::_M_init_functor(std::_Any_data&,
lambda&&, std::integral_constant) (std_function.h:252)
==10264==by 0x407939:
std::_Function_base::_Base_manager::_M_init_functor(std::_Any_data&,
lambda&&) (std_function.h:223)
==10264==by 0x4078B2: std::function::function(lambda) (std_function.h:677)
==10264==by 0x40772C: main (minimal.cpp:16)
==10264==
==10264==
==10264== HEAP SUMMARY:
==10264== in use at exit: 0 bytes in 0 blocks
==10264==   total heap usage: 2 allocs, 3 frees, 72,705 bytes allocated
==10264==
==10264== All heap blocks were freed -- no leaks are possible


[Bug fortran/91671] [10 Regression] gfortran.dg/direct_io_10.f fails at runtime with -O3

2019-09-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91671

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
Should be fixed by r275406.

[Bug fortran/91660] [8/9/10 Regression] Missing error on invalid type declaration

2019-09-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91660

--- Comment #2 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Thu Sep  5 18:14:34 2019
New Revision: 275426

URL: https://gcc.gnu.org/viewcvs?rev=275426&root=gcc&view=rev
Log:
2019-09-05  Steven G. Kargl  

PR fortran/91660
* decl.c (gfc_match_decl_type_spec): Improve and restore error
message for malformed types-spec.

2019-09-05  Steven G. Kargl  

PR fortran/91660
* gfortran.dg/pdt_4.f03: Fix invalid code.
* gfortran.dg/pr91660_1.f90: New test.
* gfortran.dg/pr91660_2.f90: Ditto.

Added:
trunk/gcc/testsuite/gfortran.dg/pr91660_1.f90
trunk/gcc/testsuite/gfortran.dg/pr91660_2.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/pdt_4.f03

[Bug c++/90537] Implement P1286R2, Contra CWG DR1778

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90537

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Marek Polacek  ---
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00311.html

[Bug c++/91581] ICE on usage requiring complete class in expcetion-specification of defaulted method

2019-09-05 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91581

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Marek Polacek  ---
Going to be fixed by
https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00311.html

[Bug target/86393] GCC-8 appears to not detect AVX512 on iMac Pro 2018

2019-09-05 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86393

Iain Sandoe  changed:

   What|Removed |Added

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

--- Comment #13 from Iain Sandoe  ---
(In reply to Mikael Slevinsky from comment #12)
> It is fixed for all GCC versions I checked: all the up-to-date versions of
> 4.9, 5, 6, 7, 8, 9 from Homebrew.

Thanks,,, closing as fixed.

[Bug fortran/91660] [8/9/10 Regression] Missing error on invalid type declaration

2019-09-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91660

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Thu Sep  5 18:37:13 2019
New Revision: 275427

URL: https://gcc.gnu.org/viewcvs?rev=275427&root=gcc&view=rev
Log:
2019-09-05  Steven G. Kargl  

PR fortran/91660
* decl.c (gfc_match_decl_type_spec): Improve and restore error
message for malformed types-spec.

2019-09-05  Steven G. Kargl  

PR fortran/91660
* gfortran.dg/pdt_4.f03: Fix invalid code.
* gfortran.dg/pr91660_1.f90: New test.
* gfortran.dg/pr91660_2.f90: Ditto.

Added:
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/pr91660_1.f90
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/pr91660_2.f90
Modified:
branches/gcc-9-branch/gcc/fortran/ChangeLog
branches/gcc-9-branch/gcc/fortran/decl.c
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/pdt_4.f03

[Bug fortran/91671] [10 Regression] gfortran.dg/direct_io_10.f fails at runtime with -O3

2019-09-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91671

janus at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #3 from janus at gcc dot gnu.org ---
(In reply to kargl from comment #2)
> Should be fixed by r275406.

Confirmed. Closing.

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

[Bug rtl-optimization/91656] [10 Regression] wrong code with -fgcse-after-reload

2019-09-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91656

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org

--- Comment #9 from janus at gcc dot gnu.org ---
*** Bug 91671 has been marked as a duplicate of this bug. ***

[Bug testsuite/91676] New: new test case gcc.dg/torture/pr91656-1.c in r275406 fails on powerpc64 BE

2019-09-05 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91676

Bug ID: 91676
   Summary: new test case gcc.dg/torture/pr91656-1.c in r275406
fails on powerpc64 BE
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

Endian issue?  Only see the failure on BE.

Program received signal SIGABRT, Aborted.
0x3fffb7cd247c in .raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install
glibc-2.17-260.el7_6.3.ppc64
(gdb) where
#0  0x3fffb7cd247c in .raise () from /lib64/libc.so.6
#1  0x3fffb7cd4688 in .abort () from /lib64/libc.so.6
#2  0x1770 in main () at
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c:22


Executing on host: /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c   
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never-O0  -fgcse-after-reload  -lm  -o ./pr91656-1.exe 
  (timeout = 300)
spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -O0 -fgcse-after-reload -lm -o ./pr91656-1.exe
PASS: gcc.dg/torture/pr91656-1.c   -O0  (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/seurer/gcc/build/gcc-test2/gcc::/home/seurer/gcc/build/gcc-test2/gcc:/home/seurer/gcc/build/gcc-test2/./gmp/.libs:/home/seurer/gcc/build/gcc-test2/./prev-gmp/.libs:/home/seurer/gcc/build/gcc-test2/./mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./isl/.libs:/home/seurer/gcc/build/gcc-test2/./prev-isl/.libs:/home/seurer/gcc/install/gcc-7.2.0/lib64
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.dg/torture/pr91656-1.c   -O0  execution test
Executing on host: /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c   
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never-O1  -fgcse-after-reload  -lm  -o ./pr91656-1.exe 
  (timeout = 300)
spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -O1 -fgcse-after-reload -lm -o ./pr91656-1.exe
PASS: gcc.dg/torture/pr91656-1.c   -O1  (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/seurer/gcc/build/gcc-test2/gcc::/home/seurer/gcc/build/gcc-test2/gcc:/home/seurer/gcc/build/gcc-test2/./gmp/.libs:/home/seurer/gcc/build/gcc-test2/./prev-gmp/.libs:/home/seurer/gcc/build/gcc-test2/./mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./isl/.libs:/home/seurer/gcc/build/gcc-test2/./prev-isl/.libs:/home/seurer/gcc/install/gcc-7.2.0/lib64
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.dg/torture/pr91656-1.c   -O1  execution test
Executing on host: /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c   
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never-O2  -fgcse-after-reload  -lm  -o ./pr91656-1.exe 
  (timeout = 300)
spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc
-B/home/seurer/gcc/build/gcc-test2/gcc/
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/torture/pr91656-1.c
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never -O2 -fgcse-after-reload -lm -o ./pr91656-1.exe
PASS: gcc.dg/torture/pr91656-1.c   -O2  (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/seurer/gcc/build/gcc-test2/gcc::/home/seurer/gcc/build/gcc-test2/gcc:/home/seurer/gcc/build/gcc-test2/./gmp/.libs:/home/seurer/gcc/build/gcc-test2/./prev-gmp/.libs:/home/seurer/gcc/build/gcc-test2/./mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpfr/src/.libs:/home/seurer/gcc/build/gcc-test2/./mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./prev-mpc/src/.libs:/home/seurer/gcc/build/gcc-test2/./isl/.libs:/home/seurer/gcc/build/gcc-test2/./prev-isl/.libs:/home/seurer/gcc/install/gcc-7.2.0/lib64
Execution timeout is: 300
spawn [open ...]
FAIL: gcc.dg/torture/pr91656-1.c   -O2  execution test
Executing on host: /home/seurer

[Bug rtl-optimization/91657] [10 regression] many failures after r275365

2019-09-05 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91657

--- Comment #3 from seurer at gcc dot gnu.org ---
It looks like it was as your fix cleaned things up.  Thanks!

[Bug bootstrap/87030] GCC fails to build with Xcode 10, attempting an impossible multilib build

2019-09-05 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87030

--- Comment #26 from Iain Sandoe  ---
Author: iains
Date: Thu Sep  5 19:14:35 2019
New Revision: 275429

URL: https://gcc.gnu.org/viewcvs?rev=275429&root=gcc&view=rev
Log:
[Darwin] Fix PR87030 and tidy config fragments.

This is about 32/64b host and multilib support across the range of Darwin
systems.

Prior to Darwin8 (OS X 10.4), the toolchains support only PowerPC and only 32b.

On Darwin8 it is possible to target a 64b multilib, but with support limited
to a few of the main libraries on the system (not a recommended configuration).

>From Darwin9 to Darwin17 (OSX 10.5 to 10.13) it is possible to have either
32 or 64b hosted toolchains, with support for a 64 or 32b multilib
respectively.

On Darwin9 the kernel is 32b, but with support for 64b executables, so it's
conventional to build a 32b host toolchain supporting a 64b multilib. However
this is not enforced (merely a convention).

There is also some platform hardware supporting Darwin10/11 which is only 32b
and for which the same situation applies. However, from Darwin10 to Darwin17,
the majority of platform hardware supports a 64b kernel and it's conventional
to build a 64b host toolchain with support for a 32b multilib.

On/from Darwin18 (OS X 10.14), the development headers (in the SDK) no longer
expose the interfaces for the 32b multilib support (although sufficient runtime
support remains installed that the testsuite can be run for a 32b multilib).

The PR is raised against this latter situation since the absence of exposed
interfaces causes a 'default' bootstrap fail regardless of the availability of
the runtimes. Given the number of permutations, I felt it warranted a general
solution, especially since the current scheme of target headers and t-make
fragments has become somewhat messy.

The changes here enforce the single 32b PowerPC multilib for Darwin < 8 and the
single X86 64b multilib for Darwin >= 18. This means that there is no longer
any need to configure Darwin18+ '--disable-multilib', but also that if you want
to use the ability to continue to test the compiler's 32b multilib there, you
need to make a configuration targeting an earlier OS version (and using the
SDK from that).

2019-09-05  Iain Sandoe  

Backport from mainline
2019-07-24  Iain Sandoe  

PR bootstrap/87030
* config/i386/darwin.h (REAL_LIBGCC_SPEC): Revert change from r273749.

PR bootstrap/87030
* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move from here...
* config/i386/darwin32-biarch.h .. to here.
* config/i386/darwin64-biarch.h: Adjust comments.
* config/rs6000/darwin32-biarch.h: Likewise.
* config/rs6000/darwin64-biarch.h: Likewise.
* config.gcc: Missed commit from r273746
(*-*-darwin*): Don't include CPU t-darwin here.
(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
an error message if i686-darwin configuration is attempted for
Darwin >= 18.

Backport from mainline
2019-07-23  Iain Sandoe  

PR bootstrap/87030
* config.gcc (*-*-darwin*): Don't include CPU t-darwin here.
(i[34567]86-*-darwin*): Adjust to use biarch files. Produce
an error message if i686-darwin configuration is attempted for
Darwin >= 18.
(x86_64-*-darwin*): Switch to single multilib for Darwin >= 18.
(powerpc-*-darwin*): Use biarch files where needed.
(powerpc64-*-darwin*): Likewise.
* config/i386/darwin.h (REAL_LIBGCC_SPEC): Move to new biarch file.
(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
arch case.
* config/i386/darwin32-biarch.h: New.
* config/i386/darwin64.h: Rename.
* gcc/config/i386/darwin64-biarch.h: To this.
* config/i386/t-darwin: Rename.
* gcc/config/i386/t-darwin32-biarch: To this.
* config/i386/t-darwin64: Rename.
* gcc/config/i386/t-darwin64-biarch: To this.
* config/rs6000/darwin32-biarch.h: New.
* config/rs6000/darwin64.h: Rename.
* config/rs6000/darwin64-biarch.h: To this.
(DARWIN_ARCH_SPEC, DARWIN_SUBARCH_SPEC): Revise for default single
arch case.
* config/rs6000/t-darwin8: Rename.
* config/rs6000/t-darwin32-biarch: To this.
* config/rs6000/t-darwin64 Rename.
* config/rs6000/t-darwin64-biarch: To this.


Added:
branches/gcc-7-branch/gcc/config/i386/darwin32-biarch.h
branches/gcc-7-branch/gcc/config/i386/darwin64-biarch.h
branches/gcc-7-branch/gcc/config/i386/t-darwin32-biarch
branches/gcc-7-branch/gcc/config/i386/t-darwin64-biarch
branches/gcc-7-branch/gcc/config/rs6000/darwin32-biarch.h
branches/gcc-7-branch/gcc/config/rs6000/darwin64-biarch.h
branches/gcc-7-branch/gcc/config/rs6000/t-darwin32-biarch
branches/gcc-7-branch/gcc/config/rs6000/t-darwin64-biarch
Removed:
branches/gcc-7-branch/gcc/config/i386/darwi

[Bug pch/61250] Random pch failures with -save-temps on x86_64-apple-darwin1(3-8).

2019-09-05 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61250

--- Comment #29 from Iain Sandoe  ---
Author: iains
Date: Thu Sep  5 19:27:31 2019
New Revision: 275431

URL: https://gcc.gnu.org/viewcvs?rev=275431&root=gcc&view=rev
Log:
[c-family] Backport fix for PCH / PR61250.

When we are parsing a source file, the very first token might
be a PRAGMA_GCC_PCH_PREPROCESS. This indicates that we are going
read in a PCH file (named as the value of the pragma). If we don't
see this pragma, then we know that it's OK to release any resources
that the host might have set aside for the PCH file.

There is a thinko in the current implementation, in that the decision
to release resources is happening unconditionally right after the first
token is extracted but before it's been checked or acted upon.

This leads to the pch bug on Darwin, because we actually do release
resources - which are subsequently (reasonably) assumed to be available
when reading a PCH file. We then get random crashes or hangs depending
on the interaction between unmmap and malloc.

The bug is present everywhere but doesn't show on (say) Linux, since
the release of PCH resources is a NOP there.

This effects all the c-family front ends, because they all use
c_lex_with_flags () to implement this.

The solution is to check for the PRAGMA_GCC_PCH_PREPROCESS and only call
c_common_no_more_pch () when that is not the first token.

A secondary effect of the collection is that the name of the PCH file
can be collected during the ggc_pch_read() reset of state. Therefore
we should issue any diagnostic that might name the file before the
collections are triggered.

gcc/

2019-09-05  Iain Sandoe  

Backport from mainline
2019-08-23  Iain Sandoe  

PR pch/61250
* ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure
and issue any diagnostics needed before collecting the pre-PCH
state.

gcc/c-family/

2019-09-05  Iain Sandoe  

Backport from mainline
2019-08-23  Iain Sandoe  

PR pch/61250
* c-lex.c (c_lex_with_flags):  Don't call
c_common_no_more_pch () from here.

gcc/c

2019-09-05  Iain Sandoe  

Backport from mainline.
2019-08-23  Iain Sandoe  

PR pch/61250
* c-parser.c (c_parse_file): Call c_common_no_more_pch ()
after determining that the first token is not
PRAGMA_GCC_PCH_PREPROCESS.

gcc/cp/

2019-09-05  Iain Sandoe  

Backported from mainline
2019-08-23  Iain Sandoe  

PR pch/61250
* parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
after determining that the first token is not
PRAGMA_GCC_PCH_PREPROCESS.


Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-lex.c
branches/gcc-7-branch/gcc/c/ChangeLog
branches/gcc-7-branch/gcc/c/c-parser.c
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/parser.c
branches/gcc-7-branch/gcc/ggc-page.c

[Bug fortran/91660] [8/9/10 Regression] Missing error on invalid type declaration

2019-09-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91660

--- Comment #4 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Thu Sep  5 19:28:04 2019
New Revision: 275432

URL: https://gcc.gnu.org/viewcvs?rev=275432&root=gcc&view=rev
Log:
2019-09-05  Steven G. Kargl  

PR fortran/91660
* decl.c (gfc_match_decl_type_spec): Improve and restore error
message for malformed types-spec.

2019-09-05  Steven G. Kargl  

PR fortran/91660
* gfortran.dg/pdt_4.f03: Fix invalid code.
* gfortran.dg/pr91660_1.f90: New test.
* gfortran.dg/pr91660_2.f90: Ditto.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pr91660_1.f90
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pr91660_2.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/decl.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/pdt_4.f03

[Bug fortran/91660] [8/9/10 Regression] Missing error on invalid type declaration

2019-09-05 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91660

kargl at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #5 from kargl at gcc dot gnu.org ---
Fixed on trunk, 8-branch, and 9-branch.  Thanks for bug report.

[Bug lto/91677] New: -fbuiltin (default) breaks static link against lto libc

2019-09-05 Thread 12f8219 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91677

Bug ID: 91677
   Summary: -fbuiltin (default) breaks static link against lto
libc
   Product: gcc
   Version: lto
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: 12f8219 at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 46836
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46836&action=edit
testcase

$ echo 'extern int puts(char *s); int _e() { return puts("hit"); }' > t.c
$ echo 'int puts(char *s) { return 123; }' > l.c

$ gcc -ffreestanding -flto -c l.c
$ gcc-ar rc l.a l.o

$ gcc -flto -fuse-linker-plugin -static -nostartfiles -e _e ./t.c ./l.a
/usr/lib/gcc/x86_64-gentoo-linux-musl/9.2.0/../../../../x86_64-gentoo-linux-musl/bin/ld:
/tmp/ccAbnIBL.ltrans0.ltrans.o: in function `_e':
:(.text+0xa): undefined reference to `puts'
collect2: error: ld returned 1 exit status

$ gcc -flto -fuse-linker-plugin -static -nostartfiles -e _e -fno-builtin ./t.c
./l.a
$

[Bug c++/91678] New: decltype returns wrong type under certain conditions

2019-09-05 Thread mednafen at sent dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91678

Bug ID: 91678
   Summary: decltype returns wrong type under certain conditions
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mednafen at sent dot com
  Target Milestone: ---

I'm not totally sure this is a bug, but the following C++ code generates a
compilation error("invalid cast of an rvalue expression of type 'float*' to
type 'float*&'") in g++ 9.2:

float* test(float* c) { return (decltype(c + 0))(float*)c; }

whereas this does not:

float* test(float* c) { return (decltype(c + 0))c; }

[Bug target/91637] Make efficient ISR prologues and epilogues on AVR available to Ada/GNAT

2019-09-05 Thread rolf.ebert.gcc at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91637

Rolf Ebert  changed:

   What|Removed |Added

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

--- Comment #1 from Rolf Ebert  ---
Sorry, bogus bug report. __gcc_isr actually works perfectly well also for gnat

[Bug lto/91677] -fbuiltin (default) breaks static link against lto libc

2019-09-05 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91677

--- Comment #1 from Andrew Pinski  ---
The builtins are not recorded in the symbol table.  There is another bug about
this same issue.

[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts

2019-09-05 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635

--- Comment #23 from Segher Boessenkool  ---
If a splitter wants a new register during combine, it should do a match_scratch
for that.  This is documented.

You do not normally get new registers during combine.  combine cannot really
handle those.  combine however goes to a lot of effort moving existing
REG_DEAD notes.

[Bug fortran/91496] !GCC$ directives error if mistyped or unknown

2019-09-05 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91496

--- Comment #5 from anlauf at gcc dot gnu.org ---
Author: anlauf
Date: Thu Sep  5 20:13:00 2019
New Revision: 275442

URL: https://gcc.gnu.org/viewcvs?rev=275442&root=gcc&view=rev
Log:
2019-09-05  Harald Anlauf  

PR fortran/91496
* parse.c (parse_executable): Improve error messages for
improperly placed pragmas not preceeding a loop.

PR fortran/91496
* gfortran.dg/directive_unroll_5.f90: Adjust error message.

Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/parse.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/directive_unroll_5.f90

[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts

2019-09-05 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635

--- Comment #24 from Segher Boessenkool  ---
(clobber of a match_operand I mean, sigh).

[Bug target/91635] wrong code at -O2 with __builtin_add_overflow() and shifts

2019-09-05 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635

--- Comment #25 from Jim Wilson  ---
Author: wilson
Date: Thu Sep  5 20:32:55 2019
New Revision: 275444

URL: https://gcc.gnu.org/viewcvs?rev=275444&root=gcc&view=rev
Log:
RISC-V: Fix bad insn splits with paradoxical subregs.

Shifting by more than the size of a SUBREG_REG doesn't work, so we either
need to disable splits if an input is paradoxical, or else we need to
generate a clean temporary for intermediate results.

Jakub wrote the first version of this patch, so gets primary credit for it.

gcc/
PR target/91635
* config/riscv/riscv.md (zero_extendsidi2, zero_extendhi2,
extend2): Don't split if
paradoxical_subreg_p (operands[0]).
(*lshrsi3_zero_extend_3+1, *lshrsi3_zero_extend_3+2): Add clobber and
use as intermediate value.

gcc/testsuite/
PR target/91635
* gcc.c-torture/execute/pr91635.c: New test.
* gcc.target/riscv/shift-shift-4.c: New test.
* gcc.target/riscv/shift-shift-5.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr91635.c
trunk/gcc/testsuite/gcc.target/riscv/shift-shift-4.c
trunk/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/riscv/riscv.md
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/91679] New: missing -Warray-bounds accessing a member array in a local buffer

2019-09-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91679

Bug ID: 91679
   Summary: missing -Warray-bounds accessing a member array in a
local buffer
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

It's relatively common to declare a character buffer on the stack and use it as
an object of some aggregate type such as a struct, including one with a
trailing array treated as a flexible array member (see for example PR 48795). 
Hacks like this are easy to make mistakes in, and introduce a stack buffer
overflow.  Unfortunately, because the cast from the type of the buffer to the
aggregate pointer obscures the true bounds of the allocated space, GCC doesn't
issue a warning for out-of-bounds accesses.

$ cat a.c && gcc -O2 -S -Wall -Wextra a.c
struct A
{
  int n;
  short a[1];
};

static void f (struct A *p)
{
  p->a[0] = 0;   // in bounds of struct A
  p->a[1] = 1;   // same
  p->a[2] = 2;   // beyond struct A but in bounds of buffer a
  p->a[3] = 3;   // same
  p->a[4] = 4;   // out of bounds, missing warning
}

void g (void*);

void h (void)
{
  char a [sizeof (struct A) + 2 * sizeof (short)];
  f ((struct A*)a);
  g (a);
}

[Bug middle-end/91679] missing -Warray-bounds accessing a member array in a local buffer

2019-09-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91679

Martin Sebor  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-09-05
 Blocks||56456
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Testing a patch.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456
[Bug 56456] [meta-bug] bogus/missing -Warray-bounds

[Bug c/78736] enum warnings in GCC (request for -Wenum-conversion to be added)

2019-09-05 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78736

--- Comment #17 from Jonny Grant  ---
Hello Joseph

This was the test case I created. There isn't any warning output when 'a_t' is
converted to 'int'. Or even if it was converted to an 'unsigned int'

https://gcc.gnu.org/ml/gcc-help/2019-07/msg00014.html


//-O2 -Wall -Wextra -Wconversion -Werror

#include 
typedef enum
{
a = -1
} a_t;

a_t f()
{
return a;
}

int main()
{
int b = f();
return b;
}

[Bug tree-optimization/91647] [10 Regression] new FAILs for Warray-bounds-8 and Wstringop-overflow-3.C

2019-09-05 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91647

Martin Sebor  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=91679
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org

--- Comment #9 from Martin Sebor  ---
I'm enhancing -Warray-bounds as mentioned at the end of comment #6.  The patch
I'm testing also includes a solution for pr91679.

[Bug fortran/91496] !GCC$ directives error if mistyped or unknown

2019-09-05 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91496

--- Comment #6 from anlauf at gcc dot gnu.org ---
Author: anlauf
Date: Thu Sep  5 21:02:44 2019
New Revision: 275445

URL: https://gcc.gnu.org/viewcvs?rev=275445&root=gcc&view=rev
Log:
2019-09-05  Harald Anlauf  

Backport from mainline
PR fortran/91496
* gfortran.h: Extend struct gfc_iterator for loop annotations.
* array.c (gfc_copy_iterator): Copy loop annotations by IVDEP,
VECTOR, and NOVECTOR pragmas.
* decl.c (gfc_match_gcc_ivdep, gfc_match_gcc_vector)
(gfc_match_gcc_novector): New matcher functions handling IVDEP,
VECTOR, and NOVECTOR pragmas.
* match.h: Declare prototypes of matcher functions handling IVDEP,
VECTOR, and NOVECTOR pragmas.
* parse.c (decode_gcc_attribute, parse_do_block)
(parse_executable): Decode IVDEP, VECTOR, and NOVECTOR pragmas;
emit warning for unrecognized pragmas instead of error.
* trans-stmt.c (gfc_trans_simple_do, gfc_trans_do): Add code to
emit annotations for IVDEP, VECTOR, and NOVECTOR pragmas.
* gfortran.texi: Document IVDEP, VECTOR, and NOVECTOR pragmas.

PR fortran/91496
* parse.c (parse_executable): Improve error messages for
improperly placed pragmas not preceeding a loop.

PR fortran/91496
* gfortran.dg/pr91496.f90: New testcase.

PR fortran/91496
* gfortran.dg/directive_unroll_5.f90: Adjust error message.

Added:
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/pr91496.f90
Modified:
branches/gcc-9-branch/gcc/fortran/ChangeLog
branches/gcc-9-branch/gcc/fortran/array.c
branches/gcc-9-branch/gcc/fortran/decl.c
branches/gcc-9-branch/gcc/fortran/gfortran.h
branches/gcc-9-branch/gcc/fortran/gfortran.texi
branches/gcc-9-branch/gcc/fortran/match.h
branches/gcc-9-branch/gcc/fortran/parse.c
branches/gcc-9-branch/gcc/fortran/trans-stmt.c
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/directive_unroll_5.f90

  1   2   >