[Bug tree-optimization/90089] Missing optimization, elimination of empty data dependant loops

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90089

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Found it, PR 67809.

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

[Bug middle-end/67809] Empty pointer-chasing loops aren't optimized out

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67809

Andrew Pinski  changed:

   What|Removed |Added

 CC||gar...@ignition-web.co.uk

--- Comment #6 from Andrew Pinski  ---
*** Bug 90089 has been marked as a duplicate of this bug. ***

[Bug tree-optimization/90089] Missing optimization, elimination of empty data dependant loops

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90089

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
  Component|c++ |tree-optimization
   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
I thought I saw a similar bug filed before but I can't seem to find it.

Also in theory, pointer deferencing could have a side effect iff the pointer is
invalid.

[Bug c++/90089] New: Missing optimization, elimination of empty data dependant loops

2019-04-14 Thread gar...@ignition-web.co.uk
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90089

Bug ID: 90089
   Summary: Missing optimization, elimination of empty data
dependant loops
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gar...@ignition-web.co.uk
  Target Milestone: ---

void * x;
void test(){ for(void * p = x; p; p=*(void**)p); }

With -O3 gives:

test():
mov rax, QWORD PTR x[rip]
testrax, rax
je  .L1
.L3:
mov rax, QWORD PTR [rax]
testrax, rax
jne .L3
.L1:
ret

As you can see it currently traverses pointers even though it could be
optimized away. 

6.8.2.2 Forward progress
The implementation may assume that any thread will eventually do one of the
following:

(1.1) terminate,
(1.2) make a call to a library I/O function,
(1.3) perform an access through a volatile glvalue, or
(1.4) perform a synchronization operation or an atomic operation.

[ Note: This is intended to allow compiler transformations such as removal of
empty loops, even when termination cannot be proven. — end note ]

MSVC and ICC performs this optimization.

[Bug target/90088] 3 ops LEA should be avoided on Intel CPUs

2019-04-14 Thread nok.raven at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90088

--- Comment #2 from Nikita Kniazev  ---
> I could see it being useful for -Os case.

Yes, and I also was confirmed that it is a bug that Clang with -Os avoids it.

[Bug rtl-optimization/87871] [9 Regression] testcases fail after r265398 on arm

2019-04-14 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87871

--- Comment #25 from Vladimir Makarov  ---
(In reply to Peter Bergner from comment #24)
> So improve_allocation() initially looks at using r0, but disregards it
> because check_hard_reg_p() returns false for r0, and that is because we fail
> this test:
> 
>   /* Checking only profitable hard regs.  */
>   if (! TEST_HARD_REG_BIT (profitable_regs, hard_regno))
> return false;
> 
> I don't know why r0 isn't in profitable_regs for pseudo 116.

Profitable regs there contain also conflict regs.  R0 is conflicting with p106.
If R0 usage (in call insn) were in the same BB, your new conflict calculation
found that there is no actual conflict.  But IRA uses df-infrastructure which
tells IRA that R0 lives at the BB end where p106 occurs.

So the right solution of the PR would be fixing df-infrastructure live analysis
or may be somehow to ignore usage of r0 in call insn. That is how see the
situation.

[Bug target/90088] 3 ops LEA should be avoided on Intel CPUs

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90088

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization

--- Comment #1 from Andrew Pinski  ---
I could see it being useful for -Os case.

[Bug target/90088] New: 3 ops LEA should be avoided on Intel CPUs

2019-04-14 Thread nok.raven at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90088

Bug ID: 90088
   Summary: 3 ops LEA should be avoided on Intel CPUs
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nok.raven at gmail dot com
  Target Milestone: ---
Target: Intel x86

Originally I filed a bug report to LLVM about

int foo(int x)
{
return (x << 1) | 1;
}

But got an answered that 3 ops LEA is intentionally avoided due to

> For LEA instructions with three source operands and some specific
> situations, instruction latency has increased to 3 cycles, and must
> dispatch via port 1:
> — LEA that has all three source operands: base, index, and offset.
> — LEA that uses base and index registers where the base is EBP, RBP, or R13.
> — LEA that uses RIP relative addressing mode.
> — LEA that uses 16-bit addressing mode.

From 3.5.1.3 (Using LEA) of Intel's Optimization Reference Manual.

https://godbolt.org/z/OqkdAO

[Bug rtl-optimization/90082] [9 Regression] ICE in delete_unmarked_insns, at dce.c:653

2019-04-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90082

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-04-14
 CC||jakub at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
   Target Milestone|--- |9.0
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with my r268544.  I'll have a look.

[Bug lto/89358] [7/8/9 Regression] Combining -std=c++14 and -std=c++17 objects gives ODR warnings

2019-04-14 Thread hubicka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89358

--- Comment #16 from Jan Hubicka  ---
Author: hubicka
Date: Sun Apr 14 20:56:45 2019
New Revision: 270355

URL: https://gcc.gnu.org/viewcvs?rev=270355=gcc=rev
Log:

PR lto/89358
* g++.dg/lto/pr89358_0.C: New testcase.
* g++.dg/lto/pr89358_1.C: New testcase.
* ipa-devirt.c (skip_in_fields_list_p): New.
(odr_types_equivalent_p): Use it.

Added:
trunk/gcc/testsuite/g++.dg/lto/pr89358_0.C
trunk/gcc/testsuite/g++.dg/lto/pr89358_1.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-devirt.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/90082] [9 Regression] ICE in delete_unmarked_insns, at dce.c:653

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90082

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||error-recovery
   Severity|normal  |minor

[Bug tree-optimization/90087] Suboptimal codegen for x < 0 ? x - INT_MIN : x

2019-04-14 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90087

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-04-14
 Ever confirmed|0   |1
   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
This is partly because GCC converts x^INT_MIN to x - INT_MIN but maybe it
should be the opposite way around.  Also it can't figure out that when x >= 0,
then x^INT_MIN is just x.

[Bug tree-optimization/90087] New: Suboptimal codegen for x < 0 ? x - INT_MIN : x

2019-04-14 Thread nok.raven at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90087

Bug ID: 90087
   Summary: Suboptimal codegen for x < 0 ? x - INT_MIN : x
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nok.raven at gmail dot com
  Target Milestone: ---
Target: x86_64,AArch64

int foo(int x)
{
return x < 0 ? x - INT_MIN : x;
}

   | GCC| Clang
---++-
x86-64 | movl   %edi, %eax  | movl %edi, %eax   
   | leal   -2147483648(%rdi), %edx | andl $2147483647, %eax
   | testl  %edi, %edi  |
   | cmovs  %edx, %eax  |
---++-
ARM64  | cmpw0, 0   | and w0, w0, #0x7fff
   | movw1, -2147483648 |
   | addw1, w0, w1  |
   | csel   w0, w1, w0, lt  |

https://godbolt.org/z/VX0Ou2

[Bug fortran/85448] Report binding label clash with a global identifyer

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85448

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #11 from Thomas Koenig  ---
Test case committed, closing.

[Bug fortran/85448] Report binding label clash with a global identifyer

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85448

--- Comment #10 from Thomas Koenig  ---
Author: tkoenig
Date: Sun Apr 14 20:15:48 2019
New Revision: 270354

URL: https://gcc.gnu.org/viewcvs?rev=270354=gcc=rev
Log:
2019-04-14  Thomas Koenig  

PR fortran/85448
* gfortran.dg/bind_c_usage_33.f90: New test and...
* gfortran.dg/bind_c_usage_33_c.c: Additional source.


Added:
trunk/gcc/testsuite/gfortran.dg/bind_c_usage_33.f90
trunk/gcc/testsuite/gfortran.dg/bind_c_usage_33_c.c
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug fortran/85448] Report binding label clash with a global identifyer

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85448

--- Comment #9 from Thomas Koenig  ---
With current trunk, I get

$ gfortran od.c odopen.f90 
$ ./a.out
 c_odopen
 odopen
unit=8 
$ gfortran od.c odopen.f90 
$ ./a.out
 c_odopen
 odopen
unit=8
$ 

which looks correct.

So, I'm going to commit a test case (better safe than sorry) and
close as fixed.

[Bug rtl-optimization/35775] collapsing popping args for tail calls at -Os

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35775

--- Comment #3 from Thomas Koenig  ---
We now get

$ cat tailcall.c 
void bar(void);
void baz(void);

void foo(int a)
{
  if (a)
bar();
  else
baz();
}
$ gcc -S -Os tailcall.c 
$ cat tailcall.s 
.file   "tailcall.c"
.text
.globl  foo
.type   foo, @function
foo:
.LFB0:
.cfi_startproc
testl   %edi, %edi
je  .L2
jmp bar
.L2:
jmp baz
.cfi_endproc
.LFE0:
.size   foo, .-foo
.ident  "GCC: (GNU) 9.0.1 20190414 (experimental)"
.section.note.GNU-stack,"",@progbits

so the original test case is fixed.

With a slightly more complex test case, we now get

$ cat tailcall2.s 
.file   "tailcall2.c"
.text
.globl  foo
.type   foo, @function
foo:
.LFB0:
.cfi_startproc
pushq   %rcx
.cfi_def_cfa_offset 16
callgargle
testl   %eax, %eax
je  .L2
popq%rdx
.cfi_remember_state
.cfi_def_cfa_offset 8
jmp bar
.L2:
.cfi_restore_state
popq%rax
.cfi_def_cfa_offset 8
jmp baz
.cfi_endproc
.LFE0:
.size   foo, .-foo
    .ident  "GCC: (GNU) 9.0.1 20190414 (experimental)"
.section.note.GNU-stack,"",@progbits

so the problem is still present in this case (using two different
registers seems strange, but it should not matter).

[Bug tree-optimization/52307] Segmentation fault in Lapack with -O3 -floop-flatten -floop-strip-mine

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52307

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #8 from Thomas Koenig  ---
Works now (not surprising after six years).

Uncluttering the data base and my personal list of bugs.

[Bug fortran/90022] Issue with CFI_is_contigous and CFI base address

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90022

Paul Thomas  changed:

   What|Removed |Added

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

--- Comment #3 from Paul Thomas  ---
Fixed on trunk - just in time.

Thanks for the report

Paul

[Bug fortran/89846] CFI_select_part creates incorrect descriptor

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89846

Paul Thomas  changed:

   What|Removed |Added

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

--- Comment #3 from Paul Thomas  ---
Fixed on trunk - just in time.

Thanks for the report

Paul

[Bug fortran/89843] CFI_section delivers incorrect result descriptor

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89843

Paul Thomas  changed:

   What|Removed |Added

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

--- Comment #3 from Paul Thomas  ---
Fixed on trunk - just in time.

Thanks for the report

Paul

[Bug fortran/89846] CFI_select_part creates incorrect descriptor

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89846

--- Comment #2 from Paul Thomas  ---
Author: pault
Date: Sun Apr 14 18:14:58 2019
New Revision: 270353

URL: https://gcc.gnu.org/viewcvs?rev=270353=gcc=rev
Log:
2019-04-14  Paul Thomas  

PR fortran/89843
* trans-decl.c (gfc_get_symbol_decl): Assumed shape and assumed
rank dummies of bind C procs require deferred initialization.
(convert_CFI_desc): New procedure to convert incoming CFI
descriptors to gfc types and back again.
(gfc_trans_deferred_vars): Call it.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Null the CFI
descriptor pointer. Free the descriptor in all cases.

PR fortran/89846
* expr.c (is_CFI_desc): New function.
(is_subref_array): Tidy up by referencing the symbol directly.
* gfortran.h : Prototype for is_CFI_desc.
* trans_array.c (get_CFI_desc): New function.
(gfc_get_array_span, gfc_conv_scalarized_array_ref,
gfc_conv_array_ref): Use it.
* trans.c (get_array_span): Extract the span from descriptors
that are indirect references.

PR fortran/90022
* trans-decl.c (gfc_get_symbol_decl): Make sure that the se
expression is a pointer type before converting it to the symbol
backend_decl type.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Eliminate
temporary creation for intent(in).

2019-04-14  Paul Thomas  

PR fortran/89843
* gfortran.dg/ISO_Fortran_binding_4.f90: Modify the value of x
in ctg. Test the conversion of the descriptor types in the main
program.
* gfortran.dg/ISO_Fortran_binding_10.f90: New test.
* gfortran.dg/ISO_Fortran_binding_10.c: Called by it.

PR fortran/89846
* gfortran.dg/ISO_Fortran_binding_11.f90: New test.
* gfortran.dg/ISO_Fortran_binding_11.c: Called by it.

PR fortran/90022
* gfortran.dg/ISO_Fortran_binding_1.c: Correct the indexing for
the computation of 'ans'. Also, change the expected results for
CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_1.f90: Correct the expected
results for CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_9.f90: New test.
* gfortran.dg/ISO_Fortran_binding_9.c: Called by it.

2019-04-14  Paul Thomas  

PR fortran/89843
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Only
return immediately if the source pointer is null. Bring
forward the extraction of the gfc type. Extract the kind so
that the element size can be correctly computed for sections
and components of derived type arrays. Remove the free of the
CFI descriptor since this is now done in trans-expr.c.
(gfc_desc_to_cfi_desc): Only allocate the CFI descriptor if it
is not null.
(CFI_section): Normalise the difference between the upper and
lower bounds by the stride to correctly calculate the extents
of the section.

PR fortran/89846
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Use
the stride measure for the gfc span if it is not a multiple
of the element length. Otherwise use the element length.

PR fortran/90022
* runtime/ISO_Fortran_binding.c (CFI_is_contiguous) : Return
1 for true and 0 otherwise to comply with the standard. Correct
the contiguity check for rank 3 and greater by using the stride
measure of the lower dimension rather than the element length.


Added:
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-decl.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_4.f90
trunk/libgfortran/ChangeLog
trunk/libgfortran/runtime/ISO_Fortran_binding.c

[Bug fortran/90022] Issue with CFI_is_contigous and CFI base address

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90022

--- Comment #2 from Paul Thomas  ---
Author: pault
Date: Sun Apr 14 18:14:58 2019
New Revision: 270353

URL: https://gcc.gnu.org/viewcvs?rev=270353=gcc=rev
Log:
2019-04-14  Paul Thomas  

PR fortran/89843
* trans-decl.c (gfc_get_symbol_decl): Assumed shape and assumed
rank dummies of bind C procs require deferred initialization.
(convert_CFI_desc): New procedure to convert incoming CFI
descriptors to gfc types and back again.
(gfc_trans_deferred_vars): Call it.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Null the CFI
descriptor pointer. Free the descriptor in all cases.

PR fortran/89846
* expr.c (is_CFI_desc): New function.
(is_subref_array): Tidy up by referencing the symbol directly.
* gfortran.h : Prototype for is_CFI_desc.
* trans_array.c (get_CFI_desc): New function.
(gfc_get_array_span, gfc_conv_scalarized_array_ref,
gfc_conv_array_ref): Use it.
* trans.c (get_array_span): Extract the span from descriptors
that are indirect references.

PR fortran/90022
* trans-decl.c (gfc_get_symbol_decl): Make sure that the se
expression is a pointer type before converting it to the symbol
backend_decl type.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Eliminate
temporary creation for intent(in).

2019-04-14  Paul Thomas  

PR fortran/89843
* gfortran.dg/ISO_Fortran_binding_4.f90: Modify the value of x
in ctg. Test the conversion of the descriptor types in the main
program.
* gfortran.dg/ISO_Fortran_binding_10.f90: New test.
* gfortran.dg/ISO_Fortran_binding_10.c: Called by it.

PR fortran/89846
* gfortran.dg/ISO_Fortran_binding_11.f90: New test.
* gfortran.dg/ISO_Fortran_binding_11.c: Called by it.

PR fortran/90022
* gfortran.dg/ISO_Fortran_binding_1.c: Correct the indexing for
the computation of 'ans'. Also, change the expected results for
CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_1.f90: Correct the expected
results for CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_9.f90: New test.
* gfortran.dg/ISO_Fortran_binding_9.c: Called by it.

2019-04-14  Paul Thomas  

PR fortran/89843
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Only
return immediately if the source pointer is null. Bring
forward the extraction of the gfc type. Extract the kind so
that the element size can be correctly computed for sections
and components of derived type arrays. Remove the free of the
CFI descriptor since this is now done in trans-expr.c.
(gfc_desc_to_cfi_desc): Only allocate the CFI descriptor if it
is not null.
(CFI_section): Normalise the difference between the upper and
lower bounds by the stride to correctly calculate the extents
of the section.

PR fortran/89846
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Use
the stride measure for the gfc span if it is not a multiple
of the element length. Otherwise use the element length.

PR fortran/90022
* runtime/ISO_Fortran_binding.c (CFI_is_contiguous) : Return
1 for true and 0 otherwise to comply with the standard. Correct
the contiguity check for rank 3 and greater by using the stride
measure of the lower dimension rather than the element length.


Added:
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-decl.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_4.f90
trunk/libgfortran/ChangeLog
trunk/libgfortran/runtime/ISO_Fortran_binding.c

[Bug fortran/89843] CFI_section delivers incorrect result descriptor

2019-04-14 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89843

--- Comment #2 from Paul Thomas  ---
Author: pault
Date: Sun Apr 14 18:14:58 2019
New Revision: 270353

URL: https://gcc.gnu.org/viewcvs?rev=270353=gcc=rev
Log:
2019-04-14  Paul Thomas  

PR fortran/89843
* trans-decl.c (gfc_get_symbol_decl): Assumed shape and assumed
rank dummies of bind C procs require deferred initialization.
(convert_CFI_desc): New procedure to convert incoming CFI
descriptors to gfc types and back again.
(gfc_trans_deferred_vars): Call it.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Null the CFI
descriptor pointer. Free the descriptor in all cases.

PR fortran/89846
* expr.c (is_CFI_desc): New function.
(is_subref_array): Tidy up by referencing the symbol directly.
* gfortran.h : Prototype for is_CFI_desc.
* trans_array.c (get_CFI_desc): New function.
(gfc_get_array_span, gfc_conv_scalarized_array_ref,
gfc_conv_array_ref): Use it.
* trans.c (get_array_span): Extract the span from descriptors
that are indirect references.

PR fortran/90022
* trans-decl.c (gfc_get_symbol_decl): Make sure that the se
expression is a pointer type before converting it to the symbol
backend_decl type.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Eliminate
temporary creation for intent(in).

2019-04-14  Paul Thomas  

PR fortran/89843
* gfortran.dg/ISO_Fortran_binding_4.f90: Modify the value of x
in ctg. Test the conversion of the descriptor types in the main
program.
* gfortran.dg/ISO_Fortran_binding_10.f90: New test.
* gfortran.dg/ISO_Fortran_binding_10.c: Called by it.

PR fortran/89846
* gfortran.dg/ISO_Fortran_binding_11.f90: New test.
* gfortran.dg/ISO_Fortran_binding_11.c: Called by it.

PR fortran/90022
* gfortran.dg/ISO_Fortran_binding_1.c: Correct the indexing for
the computation of 'ans'. Also, change the expected results for
CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_1.f90: Correct the expected
results for CFI_is_contiguous to comply with standard.
* gfortran.dg/ISO_Fortran_binding_9.f90: New test.
* gfortran.dg/ISO_Fortran_binding_9.c: Called by it.

2019-04-14  Paul Thomas  

PR fortran/89843
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Only
return immediately if the source pointer is null. Bring
forward the extraction of the gfc type. Extract the kind so
that the element size can be correctly computed for sections
and components of derived type arrays. Remove the free of the
CFI descriptor since this is now done in trans-expr.c.
(gfc_desc_to_cfi_desc): Only allocate the CFI descriptor if it
is not null.
(CFI_section): Normalise the difference between the upper and
lower bounds by the stride to correctly calculate the extents
of the section.

PR fortran/89846
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc): Use
the stride measure for the gfc span if it is not a multiple
of the element length. Otherwise use the element length.

PR fortran/90022
* runtime/ISO_Fortran_binding.c (CFI_is_contiguous) : Return
1 for true and 0 otherwise to comply with the standard. Correct
the contiguity check for rank 3 and greater by using the stride
measure of the lower dimension rather than the element length.


Added:
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_10.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_11.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_9.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/trans-array.c
trunk/gcc/fortran/trans-decl.c
trunk/gcc/fortran/trans-expr.c
trunk/gcc/fortran/trans.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_3.f90
trunk/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_4.f90
trunk/libgfortran/ChangeLog
trunk/libgfortran/runtime/ISO_Fortran_binding.c

[Bug d/90086] New: libphobos: warning: type and size of dynamic symbol `fiber_switchContext' are not defined

2019-04-14 Thread ibuclaw at gdcproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90086

Bug ID: 90086
   Summary: libphobos: warning: type and size of dynamic symbol
`fiber_switchContext' are not defined
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: d
  Assignee: ibuclaw at gdcproject dot org
  Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

FAIL: libphobos.druntime_shared/core/thread.d (test for excess errors)
Excess errors:
/usr/local/bin/ld: warning: type and size of dynamic symbol
`fiber_switchContext' are not defined


The lack of type or size directives also means the execution of the test
segfaults as well.

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

--- Comment #21 from Thomas Koenig  ---
(In reply to Thomas Koenig from comment #19)
> Comment on attachment 44718 [details]
> Affected module and example main program
> 
> The only way at the moment would be to change
> 
> program testprog
> 
>   use testmodule
> 
>   type(instlist_type),target:: instlist
>  
>   instlist%min_tstart = 42
>   instlist%max_tstop = 101
> 
>   print *, "Hello world"
>   
> end program testprog
> 
> into
> 
> program testprog
> 
>   use testmodule
> 
>   type(instlist_type),target, allocatable:: instlist
>  
>   allocate (instlist)
>   instlist%min_tstart = 42
>   instlist%max_tstop = 101
> 
>   print *, "Hello world"
>   
> end program testprog
> 
> if instlist is large enough, possibly in a front-end pass.

Actually no, this change does not work.

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #20 from Thomas Koenig  ---
Unassigning for now.  I don't think the stack part can be fixed
in the gcc 9.1 release timeframe.

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

--- Comment #19 from Thomas Koenig  ---
Comment on attachment 44718
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44718
Affected module and example main program

The only way at the moment would be to change

program testprog

  use testmodule

  type(instlist_type),target:: instlist

  instlist%min_tstart = 42
  instlist%max_tstop = 101

  print *, "Hello world"

end program testprog

into

program testprog

  use testmodule

  type(instlist_type),target, allocatable:: instlist

  allocate (instlist)
  instlist%min_tstart = 42
  instlist%max_tstop = 101

  print *, "Hello world"

end program testprog

if instlist is large enough, possibly in a front-end pass.

[Bug libgomp/90084] Parallelize libgomp testing

2019-04-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90084

--- Comment #1 from Jakub Jelinek  ---
Not parallelizing is intentional, because a big portion of the libgomp tests
spawn threads, many of them a lot of them, so the parallelization there is
already at the tests level.

[Bug rtl-optimization/87763] [9 Regression] aarch64 target testcases fail after r265398

2019-04-14 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87763

--- Comment #52 from Wilco  ---
(In reply to Jeffrey A. Law from comment #49)
> I think the insv_1 (and it's closely related insv_2) regressions can be
> fixed by a single ior/and pattern in the backend or by hacking up combine a
> bit.  I'm still playing with the latter, but may have to put it on the back
> burner because of the pain of note management :(  Hoping to draw a
> conclusion on that by the end of this  week.  If I can't get a clean combine
> solution, then my recommendation would be to build the suitable backend
> pattern.   It just has to match stuff like
> 
> (set (reg1) (ior (and (reg2) ...)) with a matching constraint on reg1 and
> reg2 to ensure it's a RMW operand.

I don't think the current insv patterns are very useful, a more general
approach would be to support bitfield insert of any immediate which is not
currently supported. This can then be expanded into a bic/orr, bic/add, mov/bfi
or movk depending on the mask/immediate.

Note the register allocation issue as discussed in PR87871 which causes the
codesize regressions after combine inserts extra moves is still the worst part
of this issue.

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

--- Comment #18 from Thomas Koenig  ---
The quadratic behavior is gone, but the very large stack usage is not
fixed yet.

Looking further.

[Bug c++/90085] New: c++17 template argument deduction results in missed optimization

2019-04-14 Thread s1445051 at mail dot zih.tu-dresden.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90085

Bug ID: 90085
   Summary: c++17 template argument deduction results in missed
optimization
   Product: gcc
   Version: 8.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: s1445051 at mail dot zih.tu-dresden.de
  Target Milestone: ---

Created attachment 46164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46164=edit
test case

When deducing template arguments of a constexpr std::array, all the elements
(strings in the test case) are stored in the data section, regardless if there
are used in the program or not. Without template argument deduction only the
accessed elements are stored in the data section. Template argument deduction
somehow prevents the reduction of the constants.

https://godbolt.org/z/q_COuU

[Bug d/88150] Use sections_elf_shared.d on Solaris

2019-04-14 Thread ibuclaw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88150

ibuclaw at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||ibuclaw at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #15 from ibuclaw at gcc dot gnu.org ---
See r270345 and r270347.

[Bug d/87799] failure during bootstrap, fails to build d/filename.o

2019-04-14 Thread ibuclaw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87799

ibuclaw at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||ibuclaw at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from ibuclaw at gcc dot gnu.org ---
Fixed in r270349.

[Bug rtl-optimization/81025] [8 Regression] gcc ICE while building glibc for MIPS soft-float multi-lib variant

2019-04-14 Thread graham.stott at btinternet dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81025

--- Comment #19 from graham.stott at btinternet dot com ---
JeffThere's trival error in gcc/config/mips/mti-linux.h which causes loads of
warnings everytime it's includedThere's a missing space between a string and
MACRO about line 28Graham





 Original message 
From: law at redhat dot com  
Date: 03/04/2019  06:00  (GMT+00:00) 
To: gcc-bugs@gcc.gnu.org 
Subject: [Bug rtl-optimization/81025] [8/9 Regression] gcc ICE while building
glibc for MIPS soft-float multi-lib variant 

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81025Jeffrey A. Law  changed:   What    |Removed
|Added
  Priority|P3  |P2 Status|WAITING  
  |NEW   Assignee|unassigned at gcc dot gnu.org 
|law at redhat dot com--- Comment #16 from Jeffrey A. Law  ---In response to c#10 and c#11.  I suspect you're not able to trigger
thefailures because of something in auto-host.h.  If I first configure &
installbinutils for the target (mips-mti-linux-gnu), then configure gcc for the
sametarget I can trigger the failures per the instructions in this BZ.What I'm
unable to figure out is my own comment WRT FRAME_RELATED_P from lastyear.  I
don't see any evidence this is at all related to FRAME_RELATED_P insnsin delay
slots.AFAICT we've done shrink wrapping on this case.  ISTM there's multiple
paths tothe epilogue, some save r16/r17 and adjust the stack pointer, others do
not(according to my reading of the dwarf2cfi pass RTL dump).  Thus triggering
theCFI failure due to the inconsistency (not to mention bogus code).So of
course the next thing to do is look at the prologue/epilogue dump andeverything
looks fine there.  Things also look fine at the .barriers dump. Then reorg
comes along and mucks things up horribly.The bug here is in reorg and its
legacy of trying to compensate for the lack ofa CFG.  In particular it has a
function skip_consecutive_labels.  The idea (ofcourse) is to have jumps target
the last label if there's several in a row. The code looks something like this:
 for (insn = label; insn != 0 && !INSN_P (insn); insn = NEXT_INSN (insn))    if
(LABEL_P (insn))  label = insn;THe loop termination condition allows the
code to look through notes and otherrandom crud.Now imagine if we
have(code_label 1)(barrier)(code_label 2)(more code)The BARRIER after a
CODE_LABEL can occur due to __builtin_unreachable.If a jump targets code_label
1, it will be redirected to code_label 2.  That'sfine from a runtime
standpoint, but runs afoul of the CFI bits.  Why?Consider if the jump which
targeted label 1 did not have a prologue (we'reshrink wrapping) and "more code"
section is a shrink wrapped epilogue.The original paths to code_label 2 will
have one CFI state while the new pathsto code_label 1 will have a different CFI
state and we trip the check.I'm spinning a fix overnight.

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

--- Comment #17 from Thomas Koenig  ---
Author: tkoenig
Date: Sun Apr 14 12:27:44 2019
New Revision: 270352

URL: https://gcc.gnu.org/viewcvs?rev=270352=gcc=rev
Log:
2019-04-14  Thomas Koenig  

PR fortran/87352
Backport from trunk
* gfortran.h (gfc_component): Add finalized field.
* class.c (finalize_component): If the component is already
finalized, return early.  Set component->finalized on exit.

2019-04-14  Thomas Koenig  

Backport from trunk
PR fortran/87352
* gfortran.dg/finalize_28.f90: Adjust count of __builtin_free.
* gfortran.dg/finalize_34.f90: New test.


Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/finalize_34.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/class.c
branches/gcc-7-branch/gcc/fortran/gfortran.h
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/finalize_28.f90

[Bug fortran/87352] [7/8/9 Regression] Large stack usage with new gfortran

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87352

--- Comment #16 from Thomas Koenig  ---
Author: tkoenig
Date: Sun Apr 14 12:17:42 2019
New Revision: 270351

URL: https://gcc.gnu.org/viewcvs?rev=270351=gcc=rev
Log:
2019-04-14  Thomas Koenig  

PR fortran/87352
Backport from trunk
* gfortran.h (gfc_component): Add finalized field.
* class.c (finalize_component): If the component is already
finalized, return early.  Set component->finalized on exit.

2019-04-14  Thomas Koenig  

Backport from trunk
PR fortran/87352
* gfortran.dg/finalize_28.f90: Adjust count of __builtin_free.
* gfortran.dg/finalize_34.f90: New test.


Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/finalize_34.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/class.c
branches/gcc-8-branch/gcc/fortran/gfortran.h
branches/gcc-8-branch/gcc/testsuite/ChangeLog
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/finalize_28.f90

[Bug c++/33661] template methods forget explicit local register asm vars

2019-04-14 Thread adobriyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33661

--- Comment #15 from Alexey Dobriyan  ---
I can only reconfirm this bug still exists with 8.2.0 after rediscovering it
independently.

Linux system calls taking 4+ arguments can't be templatized as they require

register T3 _a3 asm("r10") = a3;


But using

"r10" (a3)

in assembly input constraints doesn't work either.

[Bug libgomp/90084] New: Parallelize libgomp testing

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90084

Bug ID: 90084
   Summary: Parallelize libgomp testing
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: libgomp
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tkoenig at gcc dot gnu.org
CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Currently, testing libgomp takes a loong time because it lacks parallelization.

It would really help the testing speeds (or keep people from deselecting
it on their builds for regression testing) if this functionality was added.

[Bug fortran/89981] [8 Regression] gfortran -pedantic rejects code in 8.3.1 that is accepted with 8.3.0

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89981

--- Comment #6 from Thomas Koenig  ---
Author: tkoenig
Date: Sun Apr 14 11:26:18 2019
New Revision: 270350

URL: https://gcc.gnu.org/viewcvs?rev=270350=gcc=rev
Log:
2019-04-14  Thomas Koenig  

Backport from trunk
PR fortran/89981
* resolve.c (resolve_global_procedure): If the global symbol is an
ENTRY, also look up its name among the entries.

2019-04-14  Thomas Koenig  

Backport from trunk
PR fortran/89981
* gfortran.dg/entry_22.f90: New test.


Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/entry_22.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/resolve.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/89981] [8 Regression] gfortran -pedantic rejects code in 8.3.1 that is accepted with 8.3.0

2019-04-14 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89981

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #7 from Thomas Koenig  ---
Fixed on all affected branches, closing.

[Bug rtl-optimization/90083] New: internal compiler error: in expand_debug_locations, at cfgexpand.c:5403 with -O3 and -g

2019-04-14 Thread nheart at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90083

Bug ID: 90083
   Summary: internal compiler error: in expand_debug_locations, at
cfgexpand.c:5403 with -O3 and -g
   Product: gcc
   Version: 8.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nheart at gmail dot com
  Target Milestone: ---

Created attachment 46163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46163=edit
Sample triggering the bug

Hey,

The following code causes internal compiler error with -O{1-3} used in
conjunction with -g flag.

The bug gets triggered if you have a long a chain of functions that are
annotated with 

__attribute__ ((target ("avx2"))) 

But the attribute annotation is missing in one of them. The code compiles fine
with -mavx2:

g++ -O3 -g test.cpp -mavx2  

or with O0 (but produces warnings as expected):

g++ -O0 -g test.cpp  
test.cpp: In function ‘float fooBackend(const float*, const float*) [with
Register = __vector(8) float]’:
test.cpp:19:12: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
   Register highest = and_ps(and_me, *begin);
^~~
test.cpp:19:28: warning: AVX vector argument without AVX enabled changes the
ABI [-Wpsabi]
   Register highest = and_ps(and_me, *begin);
  ~~^~~~
test.cpp:19:28: note: The ABI for passing parameters with 32-byte alignment has
changed in GCC 4.6

Compilation also succeeds when just using O3, with warnings:

g++ -O3 test.cpp   
test.cpp: In function ‘float fooBackend(const float*, const float*) [with
Register = __vector(8) float]’:
test.cpp:19:12: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
   Register highest = and_ps(and_me, *begin); 
^~~

However trying to compile with -O3 and -g results in a compiler crash:

g++ -O3 -g test.cpp
test.cpp: In function ‘float fooBackend(const float*, const float*) [with
Register = __vector(8) float]’:
test.cpp:19:12: warning: AVX vector return without AVX enabled changes the ABI
[-Wpsabi]
   Register highest = and_ps(and_me, *begin);
^~~
during RTL pass: expand
test.cpp: In function ‘float AVX2_foo(const float*, const float*)’:
test.cpp:24:41: internal compiler error: in expand_debug_locations, at
cfgexpand.c:5403
 __attribute__ ((target ("avx2"))) float AVX2_foo(const float *begin, const
float *end) {

OS: Archlinux

[Bug rtl-optimization/90082] New: [9 Regression] ICE in delete_unmarked_insns, at dce.c:653

2019-04-14 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90082

Bug ID: 90082
   Summary: [9 Regression] ICE in delete_unmarked_insns, at
dce.c:653
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-9.0.0-alpha20190407 snapshot (r270192) ICEs when compiling the following
testcase w/ -O1 (-Og) -fnon-call-exceptions -ftrapv:

void
b (int a)
{
  if (__builtin_setjmp (0) == 0)
__asm__ ("" : : "n" (a * 2));
}

% gcc-9.0.0-alpha20190407 -O1 -fnon-call-exceptions -ftrapv -w -c m4o3ztdf.c
m4o3ztdf.c: In function 'b':
m4o3ztdf.c:5:5: error: impossible constraint in 'asm'
5 | __asm__ ("" : : "n" (a * 2));
  | ^~~
during RTL pass: rtl_dce
m4o3ztdf.c:6:1: internal compiler error: in delete_unmarked_insns, at dce.c:653
6 | }
  | ^
0x78288d delete_unmarked_insns
   
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190407/work/gcc-9-20190407/gcc/dce.c:653
0x1549c68 fast_dce
   
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190407/work/gcc-9-20190407/gcc/dce.c:1180
0x154a474 rest_of_handle_fast_dce
   
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190407/work/gcc-9-20190407/gcc/dce.c:1194

[Bug d/87799] failure during bootstrap, fails to build d/filename.o

2019-04-14 Thread jpfau at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87799

--- Comment #2 from jpfau at gcc dot gnu.org ---
Author: jpfau
Date: Sun Apr 14 09:52:22 2019
New Revision: 270349

URL: https://gcc.gnu.org/viewcvs?rev=270349=gcc=rev
Log:
PR d/87799 Fix D build on windows hosts

PR d/87799
* d-system.h (_mkdir): Forward _mkdir on MinGW to mkdir in system.h.
* configure.ac: Remove d from unsupported languages on mingw and cygwin.
* configure: Regenerate.

Modified:
trunk/ChangeLog
trunk/configure
trunk/configure.ac
trunk/gcc/d/ChangeLog
trunk/gcc/d/d-system.h

[Bug d/88150] Use sections_elf_shared.d on Solaris

2019-04-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88150

--- Comment #14 from Rainer Orth  ---
Author: ro
Date: Sun Apr 14 09:30:42 2019
New Revision: 270347

URL: https://gcc.gnu.org/viewcvs?rev=270347=gcc=rev
Log:
Work around lack of dlpi_tls_modid before Solaris 11.5

2019-04-14  Rainer Orth  
Iain Buclaw  

PR d/88150
* m4/druntime/os.m4 (DRUNTIME_OS_DLPI_TLS_MODID): New macro.
* configure.ac: Use it.
Call AC_USE_SYSTEM_EXTENSIONS.
* configure: Regenerate.
* Makefile.in, libdruntime/Makefile.in, src/Makefile.in,
testsuite/Makefile.in: Regenerate.
* libdruntime/gcc/config.d.in (OS_Have_Dlpi_Tls_Modid): Define.
* libdruntime/gcc/sections/elf_shared.d: Import gcc.config.
(scanSegments)  [OS_Have_Dlpi_Tls_Modid]: Use
dlpi_tls_modid.
[Solaris]: Use dlinfo(RTLD_DI_LINKMAP) to get rt_tlsmodid.
Otherwise clear pdso._tlsMod, pdso._tlsSize.
(getTLSRange) [Solaris && !OS_Have_Dlpi_Tls_Modid]: Readjust mod.

Modified:
trunk/libphobos/ChangeLog
trunk/libphobos/Makefile.in
trunk/libphobos/configure   (contents, props changed)
trunk/libphobos/configure.ac
trunk/libphobos/libdruntime/Makefile.in
trunk/libphobos/libdruntime/gcc/config.d.in
trunk/libphobos/libdruntime/gcc/sections/elf_shared.d
trunk/libphobos/m4/druntime/os.m4
trunk/libphobos/src/Makefile.in
trunk/libphobos/testsuite/Makefile.in

[Bug d/88150] Use sections_elf_shared.d on Solaris

2019-04-14 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88150

--- Comment #13 from Rainer Orth  ---
Author: ro
Date: Sun Apr 14 09:18:42 2019
New Revision: 270345

URL: https://gcc.gnu.org/viewcvs?rev=270345=gcc=rev
Log:
Use gcc/sections/elf_shared.d on Solaris 11.5 (PR d/88150)

PR d/88150
* libdruntime/gcc/sections/elf_shared.d [Solaris] (SharedELF): Set
to true.
Import core.sys.solaris.dlfcn, core.sys.solaris.link,
core.sys.solaris.sys.elf, core.sys.solaris.sys.link.
(dummy_ref): Declare.
(initSections): Initialize dummy_ref.
(getDependencies): Set strtab.
(handleForName): Don't dlclose handle.
(findDSOInfoForAddr): Set IterateManually.
(getprogname): Declare.
(progname): Use it.
* libdruntime/gcc/sections/package.d [Solaris]: Import
gcc.sections.elf_shared instead of gcc.sections.solaris.
* libdruntime/gcc/sections/solaris.d: Remove.
* libdruntime/Makefile.am (DRUNTIME_DSOURCES): Remove
gcc/sections/solaris.d.

Removed:
trunk/libphobos/libdruntime/gcc/sections/solaris.d
Modified:
trunk/libphobos/ChangeLog
trunk/libphobos/libdruntime/Makefile.am
trunk/libphobos/libdruntime/Makefile.in
trunk/libphobos/libdruntime/gcc/sections/elf_shared.d
trunk/libphobos/libdruntime/gcc/sections/package.d

[Bug tree-optimization/81437] missing -Wstringop-overflow reading past the end of a string

2019-04-14 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81437

--- Comment #3 from Eric Gallager  ---
(In reply to Martin Sebor from comment #2)
> GCC 9 prints the two warnings below with -m64 as well as -m32.  GCC 8.2.0
> prints them too but only in LP64 mode.  With -m32, it only warns about g.
> 
> $ gcc -O2 -S -Wall -m32 a.c
> a.c: In function ‘g’:
> a.c:12:3: warning: ‘__builtin_memcpy’ forming offset 5 is out of the bounds
> [0, 4] of object ‘a’ with type ‘const char[4]’ [-Warray-bounds]
>12 |   __builtin_memcpy (d, a + 4, n);   // missing warning
>   |   ^~
> a.c:10:14: note: ‘a’ declared here
>10 |   const char a[] = "123";
>   |  ^
> a.c: In function ‘f’:
> a.c:5:3: warning: ‘__builtin_memcpy’ forming offset [5, 2147483651] is out
> of the bounds [0, 4] of object ‘a’ with type ‘const char[4]’ [-Warray-bounds]
> 5 |   __builtin_memcpy (d, a + 4, n);   // warning (ok)
>   |   ^~
> a.c:3:14: note: ‘a’ declared here
> 3 |   const char a[] = "123";
>   |  ^

So we're down to just 1 missing warning now then?

[Bug c++/83820] No diagnostic issued for noreturn attribute specifier with an argument list

2019-04-14 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83820

Eric Gallager  changed:

   What|Removed |Added

   Keywords||accepts-invalid

--- Comment #2 from Eric Gallager  ---
(In reply to Martin Sebor from comment #1)
> Confirmed, thanks.  GCC 8 does a better job diagnosing these issues (e.g.,
> it complains about attribute malloc on a void function) but this case was
> missed in r255469.  There probably are other meaningless declarations that
> would be helpful to warn about so please open a new bug for each.

I think the reporter is asking for a hard error and not just a warning? Reads
like an accepts-invalid to me (on this reading at least)