[PATCH] Objective-C: fix protocol list count type (pertinent to non-LP64)

2021-09-26 Thread Matt Jacobson via Gcc-patches
Fix protocol list layout for non-LP64. clang and objc4 both give the `count` field as `long`, not `intptr_t`. Those are the same on LP64, but not everywhere. For non-LP64, this fixes binary compatibility with clang-built classes. This was more complicated than I anticipated, because the

Re: *PING* [PATCH] c++: fix cases of core1001/1322 by not dropping cv-qualifier of function parameter of type of typename or decltype[PR101402,PR102033,PR102034,PR102039,PR102044]

2021-09-26 Thread nick huang via Gcc-patches
>>template >>struct A >>{ >> void f(T); >>}; >> >>template >>void A::f(const T) >>{ } >> >>which is certainly questionable code, but is currently also accepted by >>clang and EDG compilers. I just found out that clang actually correctly reject this code during specialization.

Re: [PATCH] c++: Suppress error when cv-qualified reference is introduced by typedef [PR101783]

2021-09-26 Thread nick huang via Gcc-patches
Hi Jason, 1. Thank you very much for your detailed comments for my patch and I really appreciate it! Here is my revised patch: The root cause of this bug is that it considers reference with cv-qualifiers as an error by generating value for variable "bad_quals". However, this is not correct for

[PATCH] c-format: Add -Wformat-same-precision option [PR80060]

2021-09-26 Thread Daniil Stas via Gcc-patches
This option is enabled by default when -Wformat option is enabled. A user can specify -Wno-format-same-precision to disable emitting warnings about an argument passed to printf-like function having a different type from the one specified in the format string if the types precisions are the same.

[RFC] Experimental __attribute__((saturating)) on integer types.

2021-09-26 Thread Roger Sayle
This patch is prototype proof-of-concept (and request for feedback) that touches the front-end, middle-end and backend. My recent patch to perform RTL constant folding of saturating arithmetic revealed how difficult it is to generate a (portable) test case for that functionality. This patch

[RFC 6/7] Enable MIPS DSP rev3 ASE for nanoMIPS

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
gcc/ChangeLog: * config/mips/mips-dsp.md (mips_bposge): Output bposgec for TARGET_DSPR3. * config/mips/mips.c (mips_output_move): Use $ac0 for $lo if base isa doesn't have md registers. (mips_option_override) [TARGET_DSPR3]: Enable TARGET_DSP and

[RFC 7/7] Add documentation for nanoMIPS

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
gcc/ChangeLog: * doc/extend.texi: Add nanoMIPS Function Attributes, nanoMIPS Built-in Functions and nanoMIPS DSP Built-in Functions. * doc/invoke.texi: Add nanoMIPS Options. * doc/md.texi: Add nanoMIPS constraints. --- gcc/doc/extend.texi | 124 +++

[RFC 5/7] Fix unhelpful messages for disabled options.

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
Firstly, the option handling was building suggestions without checking if an option is disabled. This could have caused other unhelpful messages for other mistyped options. Secondly, the key issue here appears to be the lack of CL_JOINED flag for the false 'Condition' i.e. an option is disabled

[RFC 2/7] Make mips-classic.md entry point for mips*-*-* targets

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
Make parts of the code and options conditional on compile-time defines. gcc/ChangeLog: * config/mips/mips.h (MIPS_SUPPORT_DSP, MIPS_SUPPORT_PS_3D, MIPS_SUPPORT_MSA, MIPS_SUPPORT_LOONGSON MIPS_SUPPORT_MICROMIPS, MIPS_SUPPORT_LEGACY

[RFC 1/7] Avoid references to register names in instruction output patterns.

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
This allows us to choose the different names if needed in the future. gcc/ChangeLog: * config/mips/mips.c (mips_print_operand_punctuation): Handle '&' punctuation. (mips_output_probe_stack_range): Use '%.' instead of $0. * config/mips/mips.h

[RFC 0/7] nanoMIPS port

2021-09-26 Thread Dragan Mladjenovic via Gcc-patches
Hi all, This is somewhat a continuation of the previous effort [1] to bring nanoMIPS support upstream. We would like to move our toolchain releases [2] to something more closer to the upstream GCC. As part of that, we are interested in feedback from the community if the current approach of

Re: [PATCH] Objective-C: fix class_ro layout for non-LP64

2021-09-26 Thread Iain Sandoe
Hi Matt > On 26 Sep 2021, at 09:10, Matt Jacobson via Gcc-patches > wrote: > > Thanks for reviewing. I’m happy to make the suggested changes. One comment > inline. > >> On Sep 22, 2021, at 2:49 PM, Iain Sandoe wrote: >> >> However, the behaviour is changed - the existing implementation

[PATCH v3 3/3] reassoc: Test rank biasing

2021-09-26 Thread Ilya Leoshkevich via Gcc-patches
Add both positive and negative tests. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/reassoc-46.c: New test. * gcc.dg/tree-ssa/reassoc-46.h: Common code for new tests. * gcc.dg/tree-ssa/reassoc-47.c: New test. * gcc.dg/tree-ssa/reassoc-48.c: New test. *

[PATCH v3 2/3] reassoc: Propagate PHI_LOOP_BIAS along single uses

2021-09-26 Thread Ilya Leoshkevich via Gcc-patches
PR tree-optimization/49749 introduced code that shortens dependency chains containing loop accumulators by placing them last on operand lists of associative operations. 456.hmmer benchmark on s390 could benefit from this, however, the code that needs it modifies loop accumulator before using it,

[PATCH v3 1/3] reassoc: Do not bias loop-carried PHIs early

2021-09-26 Thread Ilya Leoshkevich via Gcc-patches
Biasing loop-carried PHIs during the 1st reassociation pass interferes with reduction chains and does not bring measurable benefits, so do it only during the 2nd reassociation pass. gcc/ChangeLog: * passes.def (pass_reassoc): Rename parameter to early_p. *

[PATCH v3 0/3] reassoc: Propagate PHI_LOOP_BIAS along single uses

2021-09-26 Thread Ilya Leoshkevich via Gcc-patches
v2: https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579976.html Changes in v3: * Do not propagate bias along tcc_references. * Call get_rank () before checking biased_names. * Add loop-carried phis to biased_names. * Move the propagate_bias_p () call outside of the loop. * Test with

[PATCH] Fix PR c/94726: ICE with __builtin_shuffle and changing of types

2021-09-26 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is __builtin_shuffle when called with two arguments instead of 1, uses a SAVE_EXPR to put in for the 1st and 2nd operand of VEC_PERM_EXPR and when we go and gimplify the SAVE_EXPR, the type is now error_mark_node and that fails hard. This fixes the problem by

Re: [PATCH] Objective-C: fix class_ro layout for non-LP64

2021-09-26 Thread Matt Jacobson via Gcc-patches
Hi Iain, Thanks for reviewing. I’m happy to make the suggested changes. One comment inline. > On Sep 22, 2021, at 2:49 PM, Iain Sandoe wrote: > > However, the behaviour is changed - the existing implementation is explicit > about the fields and > clears the reserved ones (and, ISTR, that