[Bug lto/91287] LTO disables linking with scalar MASS library (Fortran only)

2019-08-04 Thread luoxhu at cn dot ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287

--- Comment #31 from Xiong Hu XS Luo  ---
(In reply to rguent...@suse.de from comment #30)
> On Fri, 2 Aug 2019, luoxhu at cn dot ibm.com wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287
> > 
> > --- Comment #28 from Xiong Hu XS Luo  ---
> > (In reply to Richard Biener from comment #24)
> > > Btw, this is controlled by symtab_node::output_to_lto_symbol_table_p which
> > > has
> > > 
> > >   /* FIXME: Builtins corresponding to real functions probably should have
> > >  symbol table entries.  */
> > >   if (TREE_CODE (decl) == FUNCTION_DECL && fndecl_built_in_p (decl))
> > > return false;
> > > 
> > > we could try to do sth like
> > > 
> > >   if (TREE_CODE (decl) == FUNCTION_DECL
> > >   && (fndecl_built_in_p (decl, BUILT_IN_MD)
> > >   || (fndecl_built_in_p (decl, BUILT_IN_NORMAL)
> > >   && !associated_internal_fn (decl
> > > return false;
> > > 
> > > but that would still leave us with too many undefineds I guess
> > > (gcc_unreachable for one).
> > > 
> > > We do not currently track builtins that do have a library implementation
> > > (whether that it is used in the end is another thing, but less important).
> > > 
> > > What we definitely can do is put a whitelist above like via the following
> > > which also catches the case of definitions of builtins.
> > > 
> > > Index: gcc/symtab.c
> > > ===
> > > --- gcc/symtab.c(revision 273968)
> > > +++ gcc/symtab.c(working copy)
> > > @@ -2375,10 +2375,24 @@ symtab_node::output_to_lto_symbol_table_
> > >   first place.  */
> > >if (VAR_P (decl) && DECL_HARD_REGISTER (decl))
> > >  return false;
> > > +
> > >/* FIXME: Builtins corresponding to real functions probably should have
> > >   symbol table entries.  */
> > > -  if (TREE_CODE (decl) == FUNCTION_DECL && fndecl_built_in_p (decl))
> > > -return false;
> > > +  if (TREE_CODE (decl) == FUNCTION_DECL
> > > +  && !definition
> > > +  && fndecl_built_in_p (decl))
> > > +{
> > > +  if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
> > > +   switch (DECL_FUNCTION_CODE (decl))
> > > + {
> > > + CASE_FLT_FN (BUILT_IN_ATAN2):
> > > + CASE_FLT_FN (BUILT_IN_SIN):
> > > +   return true;
> > > + default:
> > > +   break;
> > > + }
> > > +  return false;
> > > +}
> > >  
> > >/* We have real symbol that should be in symbol table.  However try to
> > > trim
> > >   down the refernces to libraries bit more because linker will 
> > > otherwise
> > 
> > Hi Richard, no undefineds generated with below code, what's your opinion 
> > about
> > the updated code, please? Thanks.
> 
> It will break code calling __builtin_unreachable for example since
> we'll emit an UNDEF that cannot be satisfied.

Thanks. I tried to add __builtin_unreachable() in the test case, it can also
works. As BUILT_IN_UNREACHABLE is defined in buitins.def instead of
internal-fn.def, so associated_internal_fn will return IFN_LAST for it, then no
UNDEF of __builtin_unreachable will be emitted to object file.

Most of functions in internal-fn.def are math functions, I am not sure whether
you mean the BUILT_IN_NOP or something else?

[Bug c/50476] Warn of pointer set to object whose lifetime is limited

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

--- Comment #5 from Eric Gallager  ---
would this proposed warning go under an existing flag, or a new one?

[Bug tree-optimization/80535] missing -Wformat-overfow on POSIX directives with the apostrophe flag

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

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #2 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug c/80619] bad fix-it hint for GCC %lu directive with int argument: %wu

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

--- Comment #3 from Eric Gallager  ---
Did you do anything about this with your -Wformat-diag changes, Martin?

[Bug c/79959] -Wimplicit-fallthrough doesn't recognize some more complex exit cases

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

--- Comment #4 from Eric Gallager  ---
(In reply to Eric Gallager from comment #3)
> (In reply to Marek Polacek from comment #2)
> > Should be possible to fix this.  Mine.
> 
> For gcc 9?

...er, 10 now, I guess?

[Bug c++/91350] ICE in gimple_call_arg, at gimple.h:3190 during GIMPLE pass: cddce with options -O1 -fipa-sra

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91350

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||marxin at gcc dot gnu.org
 Resolution|--- |DUPLICATE

--- Comment #1 from Martin Liška  ---
Dup.

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

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

Martin Liška  changed:

   What|Removed |Added

 CC||zeccav at gmail dot com

--- Comment #4 from Martin Liška  ---
*** Bug 91350 has been marked as a duplicate of this bug. ***

[Bug rtl-optimization/79688] ICE with a RTL test-case and -O1 provided

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

Eric Gallager  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

--- Comment #3 from Eric Gallager  ---
assuming this is supposed to be valid, so adding ice-on-valid keyword

[Bug c/64619] No -Wsign-conversion warning

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

Eric Gallager  changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
cc-ing "new -Wconversion" author

[Bug c/78155] missing warning on invalid isalpha et al.

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

--- Comment #3 from Eric Gallager  ---
Would you expect this warning to go under an existing flag, or a new one,
Martin?

[Bug c/63710] Incorrect column number for -Wconversion

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

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #4 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug c/70619] Wrong warning with VLA, comma and sizeof

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

Eric Gallager  changed:

   What|Removed |Added

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

--- Comment #3 from Eric Gallager  ---
bug 91314 might be related to and/or a dup of this

[Bug c++/91350] New: ICE in gimple_call_arg, at gimple.h:3190 during GIMPLE pass: cddce with options -O1 -fipa-sra

2019-08-04 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91350

Bug ID: 91350
   Summary: ICE in gimple_call_arg, at gimple.h:3190 during GIMPLE
pass: cddce with options -O1 -fipa-sra
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zeccav at gmail dot com
  Target Milestone: ---

Created attachment 46670
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46670=edit
Test case from chromium build

Compiling the attached code with options -O1 -fipa-sra I get the following:

g++ -S -O1 -fipa-sra  gccerr78.C
during GIMPLE pass: cddce
p.cpp: In destructor ‘virtual Ice::Inst::~Inst()’:
p.cpp:21:1: internal compiler error: in gimple_call_arg, at gimple.h:3190
0x7b0c53 gimple_call_arg
../../gcc/gcc/gimple.h:3190
0x7b0c53 gimple_call_arg
../../gcc/gcc/gimple.h:3198
0x7b0c53 propagate_necessity
../../gcc/gcc/tree-ssa-dce.c:813
0x7b0c53 perform_tree_ssa_dce
../../gcc/gcc/tree-ssa-dce.c:1663
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/64825] -Wcast-qual does not warn about struct members which are arrays

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

Eric Gallager  changed:

   What|Removed |Added

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

--- Comment #3 from Eric Gallager  ---
Another bug for a missing -Wcast-qual: bug 91336

[Bug sanitizer/90570] AddressSanitizer: stack-use-after-scope

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90570

Martin Liška  changed:

   What|Removed |Added

 CC||geert.fannes@auro-technolog
   ||ies.com

--- Comment #13 from Martin Liška  ---
*** Bug 91328 has been marked as a duplicate of this bug. ***

[Bug sanitizer/91328] stack-use-after-scope for in-class initialization of std::vector member using initializer_list

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91328

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #1 from Martin Liška  ---
Duplicate.

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

[Bug c/80745] inconsistent warning: large integer implicitly truncated to unsigned type

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

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug c/80398] missing -Wattributes on a misplaced attribute packed in an enum definition

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

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #2 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug c/80400] missing -Wattributes on a invalid attribute packed on a typedef

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

Eric Gallager  changed:

   What|Removed |Added

 CC||dmalcolm at gcc dot gnu.org,
   ||dodji at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
cc-ing diagnostics maintainers

[Bug sanitizer/91325] [ASAN] ASAN hangs at throw if called via dlopen

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91325

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
   Target Milestone|--- |10.0

--- Comment #5 from Martin Liška  ---
Ok, then libsanitizer merge from trunk will fix it. I'm planning to do it in
autumn this year for next GCC 10.1 release.

[Bug target/91349] [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE

2019-08-04 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91349

Alan Modra  changed:

   What|Removed |Added

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

--- Comment #4 from Alan Modra  ---
Fixed.

[Bug target/91349] [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE

2019-08-04 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91349

--- Comment #3 from Alan Modra  ---
Author: amodra
Date: Mon Aug  5 01:53:31 2019
New Revision: 274106

URL: https://gcc.gnu.org/viewcvs?rev=274106=gcc=rev
Log:
PR91349, powerpc64*-*-freebsd* defines _GNU_SOURCE

rev 266496 (git ab6b1bb456) undefined some macros in rs6000/freebsd.h
but missed doing the same in rs6000/freebsd64.h.

PR target/91349
* config/rs6000/freebsd64.h (CPLUSPLUS_CPP_SPEC),
(LINK_GCC_C_SEQUENCE_SPEC): Undef.

Modified:
branches/gcc-9-branch/gcc/ChangeLog
branches/gcc-9-branch/gcc/config/rs6000/freebsd64.h

[Bug target/91349] [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE

2019-08-04 Thread amodra at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91349

--- Comment #2 from Alan Modra  ---
Author: amodra
Date: Mon Aug  5 01:52:33 2019
New Revision: 274105

URL: https://gcc.gnu.org/viewcvs?rev=274105=gcc=rev
Log:
PR91349, powerpc64*-*-freebsd* defines _GNU_SOURCE

rev 266496 (git ab6b1bb456) undefined some macros in rs6000/freebsd.h
but missed doing the same in rs6000/freebsd64.h.

PR target/91349
* config/rs6000/freebsd64.h (CPLUSPLUS_CPP_SPEC),
(LINK_GCC_C_SEQUENCE_SPEC): Undef.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/freebsd64.h

[Bug fortran/87233] Constraint C1279 still followed after f2008 standard revision (?)

2019-08-04 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87233

Jerry DeLisle  changed:

   What|Removed |Added

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

--- Comment #9 from Jerry DeLisle  ---
Fixed now on gcc9, so closing.

[Bug fortran/87233] Constraint C1279 still followed after f2008 standard revision (?)

2019-08-04 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87233

--- Comment #8 from Jerry DeLisle  ---
Author: jvdelisle
Date: Mon Aug  5 00:47:41 2019
New Revision: 274104

URL: https://gcc.gnu.org/viewcvs?rev=274104=gcc=rev
Log:
2019-08-04  Jerry DeLisle  

Backport from trunk
PR fortran/87233
* expr.c (check_restricted): Relax constraint C1279 which was
removed from F2008 and above.

* gfortran.dg/initialization_14.f90: Modify to now pass by
removing two dg-error commands. Added comments.
* gfortran.dg/initialization_30.f90: New test that includes the
two tests removed above with the 'dg-options -std=f95'.

Added:
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/initialization_30.f90
Modified:
branches/gcc-9-branch/gcc/fortran/ChangeLog
branches/gcc-9-branch/gcc/fortran/expr.c
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/initialization_14.f90

[Bug target/91349] [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE

2019-08-04 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91349

Alan Modra  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-08-04
   Assignee|unassigned at gcc dot gnu.org  |amodra at gmail dot com
 Ever confirmed|0   |1

--- Comment #1 from Alan Modra  ---
Huh, it looks like I missed adding the following to freebsd64.h:

#undef CPLUSPLUS_CPP_SPEC
#undef LINK_GCC_C_SEQUENCE_SPEC

[Bug c/91348] Missed optimization: not passing hidden pointer but copying memory

2019-08-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91348

--- Comment #1 from Marc Glisse  ---
NRVO happens in the C++ front-end, but not the C one, and the general
tree-nrv.c is rather limited.

[Bug target/91349] New: [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE

2019-08-04 Thread gerald at pfeifer dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91349

Bug ID: 91349
   Summary: [9 regression] powerpc*-*-freebsd* defines _GNU_SOURCE
   Product: gcc
   Version: 9.1.0
   URL: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=2396
48
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gerald at pfeifer dot com
CC: amodra at gcc dot gnu.org, amodra at gmail dot com,
andreast at gcc dot gnu.org
  Target Milestone: ---
Target: powerpc*-*-freebsd*

This originally was reported on the FreeBSD side as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239648 .

Between GCC 8 and GCC 9 powerpc*-*-freebsd* started to define _GNU_SOURCE
which is not appropriate on that platform and different behavior from other
FreeBSD platforms.

I believe this was introduced with

https://gcc.gnu.org/ml/gcc-patches/2018-11/msg00921.html

and 
 * config.gcc (powerpc*-*-freebsd*, powerpc-*-netbsd*),
(powerpc-*-eabisimaltivec*, powerpc-*-eabisim*, powerpc-*-elf*),
(powerpc-*-eabialtivec*, powerpc-*-eabi*, powerpc-*-rtems*),
(powerpc-wrs-vxworks*, powerpc-*-lynxos*, powerpcle-*-elf*),
(powerpcle-*-eabisim*, powerpcle-*-eabi*): Add gnu-user.h to tm_file.
* config/rs6000/freebsd.h (CPLUSPLUS_CPP_SPEC),
(LINK_GCC_C_SEQUENCE_SPEC): Undef.
(ASM_APP_ON, ASM_APP_OFF): Don't define.
* config/rs6000/freebsd64.h (ASM_APP_ON, ASM_APP_OFF): Don't define.
:

[Bug c/91348] New: Missed optimization: not passing hidden pointer but copying memory

2019-08-04 Thread no...@turm-lahnstein.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91348

Bug ID: 91348
   Summary: Missed optimization: not passing hidden pointer but
copying memory
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: no...@turm-lahnstein.de
  Target Milestone: ---

For the following example:

struct Vec3{
double x, y, z;
};

void vadd_v2(struct Vec3* a, struct Vec3* out);

struct Vec3 use_v1(struct Vec3 *in){
struct Vec3 out;
vadd_v2(in, );
return out;
}


the resulting assembler (-O2 -Wall) is:

use_v1:
pushq   %r12
movq%rdi, %r12
movq%rsi, %rdi
subq$32, %rsp
movq%rsp, %rsi
callvadd_v2
movq16(%rsp), %rax
movdqa  (%rsp), %xmm0
movq%rax, 16(%r12)
movq%r12, %rax
movups  %xmm0, (%r12)
addq$32, %rsp
popq%r12
ret

However, the hidden pointer could be passed directly into vadd_v2, which is
what clang is doing:

use_v1: # @use_v1
pushq   %rbx
movq%rdi, %rbx
movq%rsi, %rdi
movq%rbx, %rsi
callq   vadd_v2
movq%rbx, %rax
popq%rbx
retq

See also https://godbolt.org/z/rT41Sj

[Bug c/89549] [7/8/9/10 Regression] -Wmisleading-indentation is disabled from this point onwards, since column-tracking was disabled due to the size of the code/headers

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

--- Comment #9 from Eric Gallager  ---
(In reply to Dávid Bolvanský from comment #8)
> Why this annoying note cannot be disabled using 
> #pragma GCC diagnostic ignored "-Wmisleading-indentation" ?

When a note associated with a warning can't be disabled with a pragma, that
usually means that someone forgot to check the return value of the warning()
call in GCC before calling inform(), but I dunno if that's the case here... 

> 
> So only solution is -Wno-misleading-indentation?

[Bug rtl-optimization/91347] New: [7,8,9 Regression] pointer_string in linux vsprintf.c is miscompiled when sibling calls are optimized

2019-08-04 Thread danglin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91347

Bug ID: 91347
   Summary: [7,8,9 Regression] pointer_string in linux vsprintf.c
is miscompiled when sibling calls are optimized
   Product: gcc
   Version: 8.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: danglin at gcc dot gnu.org
CC: deller at gmx dot de, svens at stackframe dot org
  Target Milestone: ---
  Host: hppa-unknown-linux-gnu
Target: hppa-unknown-linux-gnu
 Build: hppa-unknown-linux-gnu

Created attachment 46669
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46669=edit
Preproccessed source

Sven Schnelle wrote:

I wasn't able to write a reproducer so far, but the problem is in
lib/vsprintf.c
pointer_string():

char *pointer_string(char *buf, char *end,
const void *ptr,
struct printf_spec spec)
{
spec.base = 16;
spec.flags |= SMALL;
if (spec.field_width == -1) {
spec.field_width = 2 * sizeof(ptr);
spec.flags |= ZEROPAD;
}

return number(buf, end, (unsigned long int)ptr, spec);
}

this generates:

3a34 :
{
3a34:   4b dc 3f 91 ldw -38(sp),ret0
3a38:   6b c2 3f d9 stw rp,-14(sp)
3a3c:   d3 9c 1f e8 extrw,s ret0,31,24,ret0
if (spec.field_width == -1) {
3a40:   93 80 37 ff cmpiclr,<> -1,ret0,r0
3a44:   34 1c 00 10 ldi 8,ret0
return number(buf, end, (unsigned long int)ptr, spec);
3a48:   4b d3 3f 91 ldw -38(sp),r19
3a4c:   34 17 00 00 ldi 0,r23
}
3a50:   4b c2 3f d9 ldw -14(sp),rp
return number(buf, end, (unsigned long int)ptr, spec);
3a54:   d6 7c 0c 08 depw ret0,31,24,r19
3a58:   6b d3 3f 91 stw r19,-38(sp)
3a5c:   e8 1e 0d bd b,l 1140 ,r0
3a60:   08 00 02 40 nop
3a64:   08 00 02 40 nop

I don't see where spec.base get's assigned, and even the source code line is
omitted in the objdump -S output.

The problem can be duplicated by compiling with -O2 or -Os.

The type of spec is:

struct printf_spec {
 unsigned int type:8;
 signed int field_width:24;
 unsigned int flags:8;
 unsigned int base:8;
 signed int precision:16;
} __attribute__((__packed__));

Reviewing the RTL dumps, I see that the assignment of spec.base is dropped in
the dse1 pass.  In vsprintf.i.258r.cse2, we have:

(insn 19 15 20 2 (set (reg:QI 113)
(const_int 16 [0x10]))
"/home/svens/linux-kernel/parisc-linux/src/lib/vsprintf.c":675 65 {*pa.md:3045}
 (nil))
(insn 20 19 63 2 (set (mem/j/c:QI (plus:SI (reg/f:SI 107)
(const_int 5 [0x5])) [241 spec.base+0 S1 A8])
(reg:QI 113))
"/home/svens/linux-kernel/parisc-linux/src/lib/vsprintf.c":675 65 {*pa.md:3045}
 (expr_list:REG_DEAD (reg:QI 113)
(expr_list:REG_DEAD (reg/f:SI 107)
(nil

This changes in vsprintf.i.259r.dse1 to:

(insn 19 15 21 2 (set (reg:QI 113)
(const_int 16 [0x10]))
"/home/svens/linux-kernel/parisc-linux/src/lib/vs
printf.c":675 65 {*pa.md:3045}
 (nil))
(jump_insn 21 19 22 2 (set (pc)
(if_then_else (eq (reg:SI 98 [ spec$field_width ])
(const_int -1 [0x]))
(label_ref 27)
(pc)))
"/home/svens/linux-kernel/parisc-linux/src/lib/vsprintf.c":67
7 30 {*pa.md:1413}
 (int_list:REG_BR_PROB 365072228 (nil))
 -> 27)

The DSE processing for insn 20 is:

**scanning insn=20
  mem: (plus:SI (reg/f:SI 107)
(const_int 5 [0x5]))

   after canon_rtx address: (plus:SI (reg/f:SI 3 %r3)
(const_int -51 [0xffcd]))
  gid=0 offset=-51
 processing const base store gid=0[-51..-50)
mems_found = 1, cannot_delete = false

starting to process insn 20
  v:  1, 2
i = -51, index = 1
deferring deletion of insn with uid = 20.

Gcc-6 doesn't drop the spec.base assignment.  Dropping the assignment causes
calls to pointer_string to be output in decimal.

[Bug middle-end/86120] ICE caused by unassociated pointer in SIZE intrinsic

2019-08-04 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86120

kargl at gcc dot gnu.org changed:

   What|Removed |Added

Summary|SIGSEGV without backtrace   |ICE caused by unassociated
   |when using submodules   |pointer in SIZE intrinsic

--- Comment #4 from kargl at gcc dot gnu.org ---
Just realized the original subject of this PR is nonsense.
There isn't a submodule in the attached code.  Updating
to something a little more reasonable.

[Bug middle-end/86120] SIGSEGV without backtrace when using submodules

2019-08-04 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86120

kargl at gcc dot gnu.org changed:

   What|Removed |Added

  Component|fortran |middle-end

--- Comment #3 from kargl at gcc dot gnu.org ---
Given the ICE in comment #2, I'm switching this to a middle-end bug.
Richard (or whoever) feel free to switch it back to fortran.  The
cause of the problem is due to an unallocated Fortran pointer in
the line with the comment.  The ICE occurs in the middle-end, but
this is likely a Fortran bug because the Fortran FE doesn't detect
the invalid reference.

[Bug fortran/86120] SIGSEGV without backtrace when using submodules

2019-08-04 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86120

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||kargl at gcc dot gnu.org

--- Comment #2 from kargl at gcc dot gnu.org ---
The code in the attached bug report is invalid, but causes an ICE.

Changing the local variable 'a' to 'c' in the function 'f' makes
it easier to see.  Here's the altered code:

program bug

  real, target, allocatable :: a(:,:)
  allocate(a(10, 10))
  a = 1.

  print *, f(a) 

  contains

   function f(b) result(x)
  real, target, intent(in):: b(:,:)
  real, pointer :: c(:,:)
  real :: x(size(c(1,:)))   ! <-- This is an invalid use of 'c'
  c => b(1:2,:)
  x = c(2,:)
   end function f

end program bug

With trunk, I see

mobile:kargl[214] gfcx -o z bug.f90
bug.f90:1:0:

1 | program bug
  | 
internal compiler error: c from f referenced in bug
0x8a7cb22 convert_nonlocal_reference_op
../../gcc/gcc/tree-nested.c:1063
0x8cab1b8 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/gcc/tree.c:12237
0x8a7cb60 convert_nonlocal_reference_op
../../gcc/gcc/tree-nested.c:1157
0x8cab1b8 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/gcc/tree.c:12237
0x8740963 walk_gimple_op(gimple*, tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:202
0x8740dbc walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:596
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e59 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:641
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e21 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:686
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e59 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:641
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e21 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:686
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e21 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:686
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e59 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:641
0x8740f3b walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:51
0x8740e21 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gcc/gimple-walk.c:686

[Bug c++/91318] [C++][PATCH] warnings about unused internal macros with -Wunused-macros and #pragma GCC optimize

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

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org
 Blocks||89180

--- Comment #2 from Eric Gallager  ---
(In reply to Piotr Henryk Dabrowski from comment #1)
> Created attachment 46656 [details]
> 0001-do-not-warn-unused-macros-pragma-gcc-optimize.patch

please send the patch to the gcc-patches mailing list for review


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89180
[Bug 89180] [meta-bug] bogus/missing -Wunused warnings

[Bug target/91342] Incorrect parameter type for AVX512 streaming intrinsics.

2019-08-04 Thread a-yee at u dot northwestern.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91342

--- Comment #2 from Alex Yee  ---
Oh I didn't realize Intel's docs were conflicting. I think most people just use
the interactive intrinsics guide.

MSVC and Intel's own compiler implement the void* variants. Thus, this comes up
when porting code coming from those.

[Bug c++/91314] Confusing warning refers to nonexistent comma operator

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

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
(In reply to Keith Thompson from comment #0)
> Test case:
> 
> int main() {
> int a;
> &(a=0);
> }
> 
> Demonstration:
> 
> $ g++ -c -Wunused-value confusing_warning.cpp 
> confusing_warning.cpp: In function ‘int main()’:
> confusing_warning.cpp:3:7: warning: right operand of comma operator has no
> effect [-Wunused-value]
> 3 | &(a=0);
>   |   ^
> 
> The problem: The warning refers to a comma operator that does not
> exist in the source.

Reminds me of bug 70619

> 
> Speculation (please ignore this if it's not useful):
> The compiler internally generates some internal data structure that's
> similar to a comma operator (something like `(a=0), `) and the
> warning message is based on that.
> 
> I've reproduced this problem with all versions of g++ I have access
> to, from 4.1.2 to 10.0.0 20190718 (experimental).
> 
> This problem was originally reported by Stefan Ram 
> on comp.lang.c++, 2019-07-24, thread "why can't I apply a bitwise modifier
> directly in a function call?".

[Bug c/91312] -Wconversion warning with += operator

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

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #6 from Eric Gallager  ---
(In reply to Andrew Pinski from comment #2)
> THis is not a bug, In C, "i += MACRO;" is equivant to:
> i = i + MACRO.
> And since you are using a type smaller than int, it is prompted to int.
> 
> NOTE there might be another bug associated with this one.

bug 40752?

[Bug c/91285] _Pragma does not work in a useful fashion

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

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
related to or dup of bug 90400 or bug 69558?

[Bug target/91341] Missing AVX Intrinsics: load/store u2

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

--- Comment #1 from Jakub Jelinek  ---
Created attachment 46668
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46668=edit
gcc10-pr91341.patch

Untested implementation.

[Bug debug/86638] Og guality failures without -ftree-sra

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

--- Comment #5 from Eric Gallager  ---
(In reply to rsand...@gcc.gnu.org from comment #4)
> Author: rsandifo
> Date: Mon Jul 29 08:52:56 2019
> New Revision: 273872
> 
> URL: https://gcc.gnu.org/viewcvs?rev=273872=gcc=rev
> Log:
> Prevent tree-ssa-dce.c from deleting stores at -Og
> 
> DCE tries to delete dead stores to local data and also tries to insert
> debug binds for simple cases:
> 
>   /* If this is a store into a variable that is being optimized away,
>  add a debug bind stmt if possible.  */
>   if (MAY_HAVE_DEBUG_BIND_STMTS
>   && gimple_assign_single_p (stmt)
>   && is_gimple_val (gimple_assign_rhs1 (stmt)))
> {
>   tree lhs = gimple_assign_lhs (stmt);
>   if ((VAR_P (lhs) || TREE_CODE (lhs) == PARM_DECL)
> && !DECL_IGNORED_P (lhs)
> && is_gimple_reg_type (TREE_TYPE (lhs))
> && !is_global_var (lhs)
> && !DECL_HAS_VALUE_EXPR_P (lhs))
>   {
> tree rhs = gimple_assign_rhs1 (stmt);
> gdebug *note
>   = gimple_build_debug_bind (lhs, unshare_expr (rhs), stmt);
> gsi_insert_after (i, note, GSI_SAME_STMT);
>   }
> }
> 
> But this doesn't help for things like "print *ptr" when ptr points
> to the local variable (tests Og-dce-1.c and Og-dce-2.c).  It can
> also introduce wrong debug info for earlier references (second test
> in Og-dce-3.c) or make earlier references unavailable (first test
> in Og-dce-3.c).
> 
> So for -Og I think it'd be better not to delete any stmts with
> vdefs for now.  This also means that we can avoid the potentially
> expensive vop walks (which already have a cut-off, but still).
> 
> The patch also fixes the Og failures in gcc.dg/guality/pr54970.c
> (PR 86638).
> 

So can this be closed now then?

> 2019-07-29  Richard Sandiford  
> 
> gcc/
>   PR debug/86638
>   * tree-ssa-dce.c (keep_all_vdefs_p): New function.
>   (mark_stmt_if_obviously_necessary): Mark all stmts with vdefs as
>   necessary if keep_all_vdefs_p is true.
>   (mark_aliased_reaching_defs_necessary): Add a gcc_checking_assert
>   that keep_all_vdefs_p is false.
>   (mark_all_reaching_defs_necessary): Likewise.
>   (propagate_necessity): Skip the vuse scan if keep_all_vdefs_p is true.
> 
> gcc/testsuite/
>   * c-c++-common/guality/Og-dce-1.c: New test.
>   * c-c++-common/guality/Og-dce-2.c: Likewise.
>   * c-c++-common/guality/Og-dce-3.c: Likewise.
> 
> Added:
> trunk/gcc/testsuite/c-c++-common/guality/Og-dce-1.c
> trunk/gcc/testsuite/c-c++-common/guality/Og-dce-2.c
> trunk/gcc/testsuite/c-c++-common/guality/Og-dce-3.c
> Modified:
> trunk/gcc/ChangeLog
> trunk/gcc/testsuite/ChangeLog
> trunk/gcc/tree-ssa-dce.c

[Bug fortran/88227] ICE in gfc_convert_boz, at fortran/target-memory.c:788

2019-08-04 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88227

kargl at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #12 from kargl at gcc dot gnu.org ---
Fixed on trunk.  Hopefully, the last of the BOZ bugs.

[Bug fortran/88227] ICE in gfc_convert_boz, at fortran/target-memory.c:788

2019-08-04 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88227

--- Comment #11 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Sun Aug  4 15:52:55 2019
New Revision: 274096

URL: https://gcc.gnu.org/viewcvs?rev=274096=gcc=rev
Log:
2019-08-04  Steven G. Kargl  

PR fortran/88227
* check.c (oct2bin):  New function.  Convert octal string to binary.
(hex2bin): New function.  Convert hexidecimal string to binary.
(bin2real): New function.  Convert binary string to REAL.  Use
oct2bin and hex2bin.
(gfc_boz2real):  Use fallback conversion bin2real.

Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/check.c

[Bug c++/91346] Implement P1668R1: Permit unevaluated inline asm in constexpr functions

2019-08-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91346

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2019-08-04
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1

[Bug c++/91346] New: Implement P1668R1: Permit unevaluated inline asm in constexpr functions

2019-08-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91346

Bug ID: 91346
   Summary: Implement P1668R1: Permit unevaluated inline asm in
constexpr functions
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

As per .

constexpr int
foo (int a, int b)
{
  if (__builtin_is_constant_evaluated ())
return a + b;
  asm("nop");
  return a;
}

[Bug target/91341] Missing AVX Intrinsics: load/store u2

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

Jakub Jelinek  changed:

   What|Removed |Added

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

[Bug target/91342] Incorrect parameter type for AVX512 streaming intrinsics.

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

Jakub Jelinek  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com,
   ||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Intel intrinsics are in constant flux.  E.g. the manual
(325462-sdm-vol-1-2abcd-3abcd.pdf) documents them as taking 
Intel C/C++ Compiler Intrinsic Equivalent
VMOVNTDQA __m512i _mm512_stream_load_si512(void * p);
MOVNTDQA __m128i _mm_stream_load_si128 (__m128i *p);
VMOVNTDQA __m256i _mm_stream_load_si256 (__m256i *p);
VMOVNTDQ void _mm512_stream_si512(void * p, __m512i a);
VMOVNTDQ void _mm256_stream_si256 (__m256i * p, __m256i a);
MOVNTDQ void _mm_stream_si128 (__m128i * p, __m128i a);
VMOVNTPD void _mm512_stream_pd(double * p, __m512d a);
VMOVNTPD void _mm256_stream_pd (double * p, __m256d a);
MOVNTPD void _mm_stream_pd (double * p, __m128d a);
VMOVNTPS void _mm512_stream_ps(float * p, __m512d a);
MOVNTPS void _mm_stream_ps (float * p, __m128d a);
VMOVNTPS void _mm256_stream_ps (float * p, __m256 a);
That is what GCC implements.  CLANG does the same thing, except uses
_mm512_stream_load_si512 (void const *__P)
https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm512_stream_=5670
documents them with void * instead.

[Bug objc/90709] [meta-bug] GNU Objective C (C++) cannot consume current headers on Darwin platforms.

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90709

Iain Sandoe  changed:

   What|Removed |Added

   Target Milestone|--- |7.5
  Known to fail||7.4.1, 8.3.1

--- Comment #7 from Iain Sandoe  ---
workaround is applied to trunk and for 9.2 (problem exists on all open
branches)

[Bug objc/90709] [meta-bug] GNU Objective C (C++) cannot consume current headers on Darwin platforms.

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90709

--- Comment #6 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 13:34:19 2019
New Revision: 274095

URL: https://gcc.gnu.org/viewcvs?rev=274095=gcc=rev
Log:
Objective-C, NeXT, backport workaround for PR90709

Since we cannot parse the current NeXT headers, because of PR90709 and its
dependents, we have a large amount of testsuite noise for Darwin platforms.
In order to restore the usefulness of the testsuite, we are going add headers
without the modern syntax elements that trigger the bug, and use these for
test runs on newer Darwin.

The headers are imported from GNUStep, with some local modifications to make
sure that __BLOCKS__ is honoured as a gate for Apple-style blocks closures.

CF-CFString.h, F-NS*.h are proxy headers that use the installed CoreFoundation
or Foundation headers on systems <= Darwin12 and the GNUStep headers for newer.

Use the CF-CFString.h, F-NS*.h proxy headers where needed in the objective-c
testsuite. Make minor adjustments to tests as required, providing that those
do not alter the test intent.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-06-15  Iain Sandoe  

PR objc/90709
* obj-c++.dg/proto-lossage-7.mm: Use proxy headers.
* obj-c++.dg/strings/const-cfstring-2.mm: Likewise.
* obj-c++.dg/strings/const-cfstring-5.mm: Likewise
* obj-c++.dg/strings/const-str-12.mm: Likewise.
* obj-c++.dg/syntax-error-1.mm: Likewise.
* obj-c++.dg/torture/strings/const-cfstring-1.mm: Likewise.
* obj-c++.dg/torture/strings/const-str-10.mm: Likewise.
* obj-c++.dg/torture/strings/const-str-11.mm: Likewise.
* obj-c++.dg/torture/strings/const-str-9.mm: Likewise.
* obj-c++.dg/cxx-ivars-3.mm: Skip on later Darwin, where the 10.4 API
in no longer supported, also on m64 where there's no meaning to it.
* obj-c++.dg/isa-field-1.mm: Suppress unwanted warning, add comment
why.
* obj-c++.dg/objc-gc-3.mm: Skip for Darwin > 16, the API use is an
error
there.
* obj-c++.dg/qual-types-1.mm: Prune a spurious l64 warning.
* obj-c++.dg/stubify-1.mm: Tidy up after better compiler warnings.
* obj-c++.dg/stubify-2.mm: Likewise.
* obj-c++.dg/try-catch-1.mm: Likewise.
* obj-c++.dg/try-catch-3.mm: Likewise.

Backport from mainline.
2019-06-15  Iain Sandoe  

PR objc/90709
* objc.dg/encode-7-next-64bit.m: Use proxy headers.
* objc.dg/image-info.m: Likewise.
* objc.dg/method-6.m: Likewise.
* objc.dg/no-extra-load.m: Likewise.
* objc.dg/objc-foreach-4.m: Likewise.
* objc.dg/objc-foreach-5.m: Likewise.
* objc.dg/proto-lossage-7.m: Likewise.
* objc.dg/strings/const-cfstring-2.m: Likewise.
* objc.dg/strings/const-cfstring-5.m: Likewise.
* objc.dg/strings/const-str-12b.m: Likewise.
* objc.dg/symtab-1.m: Likewise.
* objc.dg/torture/strings/const-cfstring-1.m: Likewise.
* objc.dg/torture/strings/const-str-10.m: Likewise.
* objc.dg/torture/strings/const-str-11.m: Likewise.
* objc.dg/torture/strings/const-str-9.m: Likewise.
* objc.dg/zero-link-1.m: Likewise.
* objc.dg/zero-link-2.m: Likewise.
* objc.dg/zero-link-3.m: Likewise.
* objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why.
* objc.dg/headers.m: XFAIL for Darwin14-19.
* objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error
there.

Backport from mainline.
2019-06-15  Iain Sandoe  

PR objc/90709
* objc-obj-c++-shared/CF-CFString.h: New.
* objc-obj-c++-shared/F-NSArray.h: New.
* objc-obj-c++-shared/F-NSAutoreleasePool.h: New.
* objc-obj-c++-shared/F-NSObject.h: New.
* objc-obj-c++-shared/F-NSString.h: New.
* objc-obj-c++-shared/F-NSValue.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFArray.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFAvailability.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFBase.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFCharacterSet.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFData.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFDictionary.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFLocale.h: New.
* objc-obj-c++-shared/GNUStep/CoreFoundation/CFString.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSArray.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSAutoreleasePool.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSDate.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSEnumerator.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSGeometry.h: New.
* objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h: New.
* 

[Bug gcov-profile/91087] g++.dg/gcov/pr16855.C fails everywhere on Darwin.

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91087

Iain Sandoe  changed:

   What|Removed |Added

   Target Milestone|10.0|7.5

--- Comment #4 from Iain Sandoe  ---
fixed on trunk and for 9.2 (this fails on all open branches)

[Bug gcov-profile/91087] g++.dg/gcov/pr16855.C fails everywhere on Darwin.

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91087

--- Comment #3 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 13:12:26 2019
New Revision: 274092

URL: https://gcc.gnu.org/viewcvs?rev=274092=gcc=rev
Log:
Darwin, testsuite, backport fix for 91087.

The testcase is failing to instrument part of the source because of a bug
in the ordering of static DTORs. It seems unlikely that this is generically
fixable in the toolchain (and given that it's likely to be a dynamic loader
change would not be expected to be applied retrospectively to OS versions
that are out of support). To avoid the testsuite noise, xfail the count lines
that don't match (we can adjust the xfails as/when the upstream bug is fixed).

dejagnu xfails do not seem to work when embedded in a line like:
~Test (void) {  /* count(1) { xfail ... } */ }
the closing brace seems to confuse the parser. The solution is to exapnd the
text onto three lines.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-07-25  Iain Sandoe  

PR gcov-profile/91087
* g++.dg/gcov/pr16855.C: Xfail the count lines for the DTORs and the
"final" line for the failure summaries.  Adjust source layout so that
dejagnu xfail expressions work.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/g++.dg/gcov/pr16855.C

[Bug testsuite/65364] FAIL: gcc.dg/uninit-19.c (test for warnings, line 22)

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65364

Iain Sandoe  changed:

   What|Removed |Added

 CC||iains at gcc dot gnu.org

--- Comment #6 from Iain Sandoe  ---
fixed on Darwin for trunk and for 9.2

[Bug testsuite/65364] FAIL: gcc.dg/uninit-19.c (test for warnings, line 22)

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65364

--- Comment #5 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 12:04:06 2019
New Revision: 274076

URL: https://gcc.gnu.org/viewcvs?rev=274076=gcc=rev
Log:
Darwin, testsuite, backport fix for PR65364

This test currently fails on Darwin, because the port inlines fn2 for
both PIC (and non-pic for m32).  Fixed by adjusting the target condition.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-06-11  Iain Sandoe  

PR testsuite/65364
* gcc.dg/uninit-19.c (fn1): Adjust target condition for Darwin.
(fn2): Likewise.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.dg/uninit-19.c

[Bug target/90698] Darwin X86 backend lacks support for mcmodel={medium, large, kernel}

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90698

--- Comment #7 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 11:54:13 2019
New Revision: 274073

URL: https://gcc.gnu.org/viewcvs?rev=274073=gcc=rev
Log:
Darwin, X86, backport test adjusts for PR90698.

We don't have support for -mcmodel={medium, large, kernel} so don't
expect tests for those things to work.

For now mark them as xfail where possible and skip where that isn't.
These changes will be logged onto the PR and therefore can be backed
out when the facility is implemented.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-06-01  Iain Sandoe  

PR target/90698
* gcc.target/i386/pr49866.c: XFAIL for Darwin.
* gcc.target/i386/pr63538.c: Likewise.
* gcc.target/i386/pr61599-1.c: Skip for Darwin.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr49866.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr61599-1.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr63538.c

[Bug rtl-optimization/64895] RA picks the wrong register for -fipa-ra

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64895

--- Comment #19 from Iain Sandoe  ---
testsuite fix applied for pic targets on trunk and 9.2

[Bug rtl-optimization/64895] RA picks the wrong register for -fipa-ra

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64895

--- Comment #18 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 10:24:34 2019
New Revision: 274062

URL: https://gcc.gnu.org/viewcvs?rev=274062=gcc=rev
Log:
Darwin, X86, backport fixes for 64895.

Although this is marked as rtl-optimisation, the Darwin
issue is that the testcase XPASS there since the codegen
is different.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-05-23  Iain Sandoe  

PR rtl-optimisation/64895
* gcc.target/i386/fuse-caller-save-rec.c: Remove XFAILs.
* gcc.target/i386/fuse-caller-save.c: Likewise.
* gcc.target/i386/fuse-caller-save-xmm.c: Adjust tests for
PIC cases, remove XFAILs.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/fuse-caller-save-rec.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/fuse-caller-save-xmm.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/fuse-caller-save.c

[Bug testsuite/27221] g++.dg/ext/alignof2.C fails on powerpc-darwin (and powerpc-aix)

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27221

--- Comment #6 from Iain Sandoe  ---
fixed on trunk and for 9.2

[Bug testsuite/27221] g++.dg/ext/alignof2.C fails on powerpc-darwin (and powerpc-aix)

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27221

--- Comment #5 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 10:11:53 2019
New Revision: 274061

URL: https://gcc.gnu.org/viewcvs?rev=274061=gcc=rev
Log:
Darwin, testsuite, backport for for 27221.

This can't pass on 32b power Darwin, since the ABI conflicts.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-05-22  Iain Sandoe  

PR testsuite/27221
* g++.dg/ext/alignof2.C: XFAIL for 32bit Darwin.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/g++.dg/ext/alignof2.C

[Bug testsuite/67958] The tests changed by r223498 now FAILs on darwin

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67958

Iain Sandoe  changed:

   What|Removed |Added

   Target Milestone|--- |7.5

--- Comment #8 from Iain Sandoe  ---
fixed on trunk and for 9.2

[Bug testsuite/67958] The tests changed by r223498 now FAILs on darwin

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67958

--- Comment #7 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 10:06:33 2019
New Revision: 274060

URL: https://gcc.gnu.org/viewcvs?rev=274060=gcc=rev
Log:
Darwin, X86, backport testsuite fix for 67958.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-05-21  Iain Sandoe  

PR testsuite/67958
* gcc.target/i386/pr32219-1.c: Adjust scan-asms for Darwin, comment
the differences.
* gcc.target/i386/pr32219-2.c: Likewise.
* gcc.target/i386/pr32219-3.c: Likewise.
* gcc.target/i386/pr32219-4.c: Likewise.
* gcc.target/i386/pr32219-5.c: Likewise.
* gcc.target/i386/pr32219-6.c: Likewise.
* gcc.target/i386/pr32219-7.c: Likewise.
* gcc.target/i386/pr32219-8.c: Likewise.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-1.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-2.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-3.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-4.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-5.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-6.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-7.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/pr32219-8.c

[Bug target/63891] [7/8/9 regression] Failure of darwin-weakimport-3.c

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63891

--- Comment #15 from Iain Sandoe  ---
fixed on trunk and for 9.2

[Bug target/63891] [7/8/9 regression] Failure of darwin-weakimport-3.c

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63891

--- Comment #14 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 09:59:21 2019
New Revision: 274059

URL: https://gcc.gnu.org/viewcvs?rev=274059=gcc=rev
Log:
Darwin, testsuite, backport fix for PR83891

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-05-21  Iain Sandoe  

PR target/63891
* gcc.dg/darwin-weakimport-3.c: Adjust options and explain
the reasons.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.dg/darwin-weakimport-3.c

[Bug testsuite/58321] FAIL: gcc.target/i386/memcpy-strategy-3.c scan-assembler-times memcpy 2 on x86_64-apple-darwin*

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58321

--- Comment #10 from Iain Sandoe  ---
fixed for trunk and 9.2

[Bug testsuite/58321] FAIL: gcc.target/i386/memcpy-strategy-3.c scan-assembler-times memcpy 2 on x86_64-apple-darwin*

2019-08-04 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58321

--- Comment #9 from Iain Sandoe  ---
Author: iains
Date: Sun Aug  4 09:53:37 2019
New Revision: 274058

URL: https://gcc.gnu.org/viewcvs?rev=274058=gcc=rev
Log:
Darwin, X86, backport fix for PR58321.

2019-08-04  Iain Sandoe  

Backport from mainline.
2019-05-20  Iain Sandoe  

PR testsuite/58321
* gcc.target/i386/memcpy-strategy-3.c: Adjust count for Darwin and
add a comment as to the reason for the difference.
* gcc.target/i386/memset-strategy-1.c: Likewise.


Modified:
branches/gcc-9-branch/gcc/testsuite/ChangeLog
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/memcpy-strategy-3.c
branches/gcc-9-branch/gcc/testsuite/gcc.target/i386/memset-strategy-1.c

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-04 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

David Binderman  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #3 from David Binderman  ---
Another way to generate the same crash is to compile file
gcc testsuite file g++.old-deja/g++.oliva/new1.C with compiler flag -O2.

during GIMPLE pass: cddce
./g++.old-deja/g++.oliva/new1.C: In function â<80><98>int main()â<80><99>:
./g++.old-deja/g++.oliva/new1.C:20:43: internal compiler error: in
gimple_call_arg, at gimple.h:3190

[Bug c++/91345] New: Typedef'ed restrict pointers may break compilation.

2019-08-04 Thread a-yee at u dot northwestern.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91345

Bug ID: 91345
   Summary: Typedef'ed restrict pointers may break compilation.
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: a-yee at u dot northwestern.edu
  Target Milestone: ---

Potentially Related:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91344


The following code compiles on Clang, MSVC, and ICC. But it fails on GCC.

https://godbolt.org/z/6pTjDc


#ifdef _WIN32
#define RESTRICT __restrict
#else
#define RESTRICT __restrict__
#endif

template  using r_ptr  = type *RESTRICT;

template 
class Child{
void func(r_ptr ptr);
};

template <> void Child::func(r_ptr ptr){}



GCC fails to compile it:

:8:18: error: template-id 'func<>' for 'void
Child::func(r_ptr)' does not match any template declaration

8 | template <> void Child::func(r_ptr ptr){}

  |  ^~

:8:49: note: saw 1 'template<>', need 2 for specializing a member
function template

8 | template <> void Child::func(r_ptr ptr){}

  | ^

ASM generation compiler returned: 1

:8:18: error: template-id 'func<>' for 'void
Child::func(r_ptr)' does not match any template declaration

8 | template <> void Child::func(r_ptr ptr){}

  |  ^~

:8:49: note: saw 1 'template<>', need 2 for specializing a member
function template

8 | template <> void Child::func(r_ptr ptr){}

  | ^

Execution build compiler returned: 1