Re: strub causing libgcc to fail to build on rl78-elf

2023-12-06 Thread DJ Delorie via Gcc
Alexandre Oliva writes: > This looks like a latent bug in the port. I'm not surprised, that port was weird. > This was just a plain asm insn in strub.c: > > /* Make sure the stack overwrites are not optimized away. */ > asm ("" : : "m" (end[0])); > > whose constraint passes during reload, r

Re: Update to GCC copyright assignment policy

2021-06-01 Thread DJ Delorie via Gcc
"Maciej W. Rozycki" writes: > My interpretation of this would be for modifications rather than original > sources, so v3+ applies to unmodified sources (for obvious reasons, given > that the recipient of the sources is not a copyright holder), however as a > copyright holder I can release my m

Re: Update to GCC copyright assignment policy

2021-06-01 Thread DJ Delorie via Gcc
Paul Koning via Gcc writes: >> GCC's license is "GPL version 3 or later", so if there ever needed to be a >> GPL v4, we could move to it without needing permission from anyone. > > I don't think that is what the license says. It says: > > GCC is free software; you can redistribute it and/or modif

Re: Status of m32c target?

2018-01-15 Thread DJ Delorie
Jeff Law writes: > A change in reload back in 2016 (IIRC) has effectively made m32c > unusable. The limits of the register file create horrible problems for > reload. > > I was going to suggest deprecation for gcc-8 given how badly it was > broken in gcc-7 and the lack of maintenance on the targ

Re: Status of m32c target?

2018-01-12 Thread DJ Delorie
Jeff Law writes: > I was going to suggest deprecation for gcc-8 given how badly it was > broken in gcc-7 and the lack of maintenance on the target. As much as I use the m32c target, I have to agree. I've tried many times to fix its reload problems to no avail, and just don't have time to work o

Re: targetm.calls.promote_prototypes parameter

2017-12-06 Thread DJ Delorie
Jason Merrill writes: > I'm inclined to change the C++ FE to pass NULL_TREE instead until such > time as someone cares. The sh backend will at least not choke on that ;-)

Re: targetm.calls.promote_prototypes parameter

2017-12-06 Thread DJ Delorie
In my original proposal, I said this: > It includes a bunch of macro->hook conversions, mostly because the > hooks need an additional parameter (the function) to detect which ones > are Renesas ABI and which are GCC ABI. The original documentation at least hinted that the parameter was a functio

Re: Why are GCC Internals not Specification Driven ?

2016-12-19 Thread DJ Delorie
Seima Rao writes: > Has gcc become proprietory/commercial ? By definition: no, yes. It's been this way since the beginning, and hasn't changed in decades. > Or has it become illegal to publish specification models > of gcc internals ? Does this make the product sell less ? This

Re: [GCC Steering Committee attention] [PING] [PING] [PING] libgomp: In OpenACC testing, cycle though $offload_targets, and by default only build for the offload target that we're actually going to te

2016-08-04 Thread DJ Delorie
Manuel Lpez-Ibñez writes: > Another question is how to help existing maintainers such that they > are more motivated to review patches. Is it a lack of time? lack of > Interest in the project? do patches simply fall through the cracks? is > it a dead-lock of people waiting for each other to comme

Re: [GCC Steering Committee attention] [PING] [PING] [PING] libgomp: In OpenACC testing, cycle though $offload_targets, and by default only build for the offload target that we're actually going to te

2016-08-04 Thread DJ Delorie
Manuel Lpez-Ibñez writes: > I don't see how that helps. Neither my message nor Thomas's is a > criticism of people. The question is how to get more people to help > and how to improve the situation. For sure, everybody is doing the > best that they can with the time that they have. You complaine

Re: [GCC Steering Committee attention] [PING] [PING] [PING] libgomp: In OpenACC testing, cycle though $offload_targets, and by default only build for the offload target that we're actually going to te

2016-08-04 Thread DJ Delorie
Manuel Lpez-Ibñez writes: > none? for libiberty, no regular maintainer for build machinery, Perhaps this is a sign that I should step down as maintainers for those?

Re: gcc/libcpp: non-UTF-8 source or execution encodings?

2016-07-19 Thread DJ Delorie
David Edelsohn writes: > GCC on the system is not self-hosting -- I believe that GCC only is > used as a cross-compiler. I can confirm this - GCC for TPF is always a cross compiler, it never runs *on* a TPF system.

Re: Deprecating basic asm in a function - What now?

2016-06-20 Thread DJ Delorie
Given how many embedded ports have #defines in external packages for basic asms for instructions such as nop, enable/disable interrupts, other system-level opcodes, etc... I think this is a bad idea. Even glibc would break. #define enable() asm("eint") __asm__ __volatile__ ("fwait");

Re: Proposal to deprecate: mep (Toshiba Media Processor)

2016-03-01 Thread DJ Delorie
> Given a combination of "I have new responsibilities" and "nothing has > happened with mep for a long time" I would like to step down as mep > maintainer. > > If someone would like to pick up maintainership of this target, please > contact me and/or the steering committee. Otherwise, I propose

who owns stack args?

2016-02-24 Thread DJ Delorie
Consider this example (derived from gcc.c-torture/execute/920726-1.c): extern int a(int a, int b, int c, int d, int e, int f, const char *s1, const char *s2) __attribute__((pure)); int foo() { if (a(0,0,0,0,0,0,"abc","def") || a(0,0,0,0,0,0,"abc","ghi")) return 0; return 1

Proposal to deprecate: mep (Toshiba Media Processor)

2015-12-03 Thread DJ Delorie
Given a combination of "I have new responsibilities" and "nothing has happened with mep for a long time" I would like to step down as mep maintainer. If someone would like to pick up maintainership of this target, please contact me and/or the steering committee. Otherwise, I propose this target

Re: Is anyone working on a Z80 port?

2015-10-14 Thread DJ Delorie
> I spec'd one out a long time ago for Cygnus/Red Hat, but we never > pursued the port. The register model on the z80 will be problematical, > though some of the lessons from the rl78 port would probably be useful. The RL78 is very much a modern decendent of the Z80 architecture so might serve

Re: reload question about unmet constraints

2015-10-06 Thread DJ Delorie
> So in general, it's really not safe to mark a constraint that accepts > only far memory as "memory constraint" with current reload. > > Note that *not* marking the constraint as memory constraint actually > does not prevent reload from fixing up illegitimate addresses, so you > shouldn't really

Re: Repository for the conversion machinery

2015-09-17 Thread DJ Delorie
Richard Biener writes: >> Using d...@gcc.gnu.org would imply that is my email address, but email >> sent there would vanish. > > Would it? You're supposed to have a valid forwarding address on that. Frank tested it and it does seem to forward to me, so I guess so.

Re: Repository for the conversion machinery

2015-09-16 Thread DJ Delorie
"Frank Ch. Eigler" writes: > That makes sense, but how many people are in cagney's shoes I am one of those people - I have two email addresses listed in MAINTAINERS, with two sets of copyright papers filed with the FSF (a personal assignment and a work one). I use the appropriate email address

Re: reload question about unmet constraints

2015-09-16 Thread DJ Delorie
> And in fact, you should be able to decide at *expand* time which > of the two you need for the given set of operands. I already check for multiple fars at expand, and force all but one of them to registers. Somewhere before reload they get put back in. >"rl78_virt_insns_ok () && rl78_far_

Re: reload question about unmet constraints

2015-09-15 Thread DJ Delorie
> I see. Is it correct then to say that reload will never be able to > change a near mem into a far mem or vice versa? If that is true, there > doesn't appear to be any real benefit to having both near and far mem > operations as *alternatives* to the same insn pattern. The RL78 has a segment r

Re: reload question about unmet constraints

2015-09-14 Thread DJ Delorie
> You would need some way to indicate that while Y does accept a mem, > this particular mem can't be reloaded to match. We don't have a way > to do that. As a test, I added this API. It seems to work. I suppose there could be a better API where we determine if a constrain matches various memor

Re: reload question about unmet constraints

2015-09-01 Thread DJ Delorie
> It did match the first alternative (alternative 0), but it matched the > constraints Y/Y/m. It shouldn't match Y as those are for near addresses (unless it's only matching MEM==MEM), and the ones in the insn are far, but ... > Reload doesn't have any concept of two different kinds of memory >

reload question about unmet constraints

2015-09-01 Thread DJ Delorie
Given this test case for rl78-elf: extern __far int a, b; void ffr (int x) { a = b + x; } I'm trying to use this patch: Index: gcc/config/rl78/rl78-virt.md === --- gcc/config/rl78/rl78-virt.md (revision 227360) +++ gcc/confi

Re: Repository for the conversion machinery

2015-08-27 Thread DJ Delorie
> If you want your commits to be attributed to two different addresses > in the git conversion, you need to tell me how to specify two > different selection sets so I can write assign statements and two > trivial "authors read" commands affecting them only. > > assuming that the names m32c and djg

Re: Repository for the conversion machinery

2015-08-27 Thread DJ Delorie
Hmmm... I use two email addresses for commits, depending on which target they're for, i.e.: $ grep DJ MAINTAINERS m32c port DJ Delorie DJGPP DJ Delorie Most of the DJGPP stuff was long ago but I wonder how the conversion would h

Re: Offer of help with move to git

2015-08-23 Thread DJ Delorie
> In the mean time, I'm enclosing a contributor map that will need to be > filled in whoever does the conversion. The right sides should become > full names and preferred email addresses. This information should be gleanable from the Changelog commits... do you have a script to scan those?

Re: Question about "instruction merge" pass when optimizing for size

2015-08-19 Thread DJ Delorie
I've seen this on other targets too, sometimes so bad I write a quick target-specific "stupid move optimizer" pass to clean it up. A generic pass would be much harder, but very useful.

Re: s390: larl for Simode on 64-bit

2015-07-08 Thread DJ Delorie
> So in effect, we have two pointer sizes, 64 being the default, but > we can also get a 32 bit pointer via the syntax above? Wow, I'm > surprised that works. Yup, been that way for many years. > And the only time we'd be able to use larl is a dereference of a > pointer declared with the syntax

Re: s390: larl for Simode on 64-bit

2015-07-08 Thread DJ Delorie
In the TPF case, the software has to explicitly mark such pointers as SImode (such things happen only when structures that contain addresses can't change size, for backwards compatibility reasons[1]): int * __attribute__((mode(SImode))) ptr; ptr = &some_var; so I wouldn't consider this the "d

s390: larl for Simode on 64-bit

2015-07-08 Thread DJ Delorie
Is there any reason that LARL can't be used to load a 32-bit symbolic value, in 64-bit mode? On TPF (64-bit) the app has the option of being loaded in the first 4Gb so that all symbols are also valid 32-bit addresses, for backward compatibility. (and if not, the linker would complain) Index: s3

Re: rl78 vs cse vs memory_address_addr_space

2015-07-06 Thread DJ Delorie
> Did you try just a define_split instead? Ugly, but it should work I think. It doesn't seem to be able to match a define_split :-(

Re: rl78 vs cse vs memory_address_addr_space

2015-07-06 Thread DJ Delorie
Given a test case like this: typedef struct { unsigned char no0 :1; unsigned char no1 :1; unsigned char no2 :1; unsigned char no3 :1; unsigned char no4 :1; unsigned char no5 :1; unsigned char no6 :1; unsigned char no7 :1; } __BITS8; #define

rl78 vs cse vs memory_address_addr_space

2015-07-01 Thread DJ Delorie
In this bit of code in explow.c: /* By passing constant addresses through registers we get a chance to cse them. */ if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x)) x = force_reg (address_mode, x); On the rl78 it results in code that's a bit too complex for later

dwarf DW_AT_decl_name: system headers vs source files?

2015-06-19 Thread DJ Delorie
Consider: # 1 "dj.c" # 1 "dj.h" 1 3 int dj(int x); # 2 "dj.c" 2 int dj(int x) { } If you compile with -g and look at the dwarf output, you see: <1><2d>: Abbrev Number: 2 (DW_TAG_subprogram) <2e> DW_AT_external: 1 <2e> DW_AT_name: dj <31> DW_AT_decl_file : 2

s390: SImode pointers vs LR

2015-05-29 Thread DJ Delorie
In config/s390/s390.c we accept addresses that are SImode: if (!REG_P (base) || (GET_MODE (base) != SImode && GET_MODE (base) != Pmode)) return false; However, there doesn't seem to be anything in the s390's opcodes that masks the top half of address registe

Re: Newlib/Cygwin now under GIT

2015-03-10 Thread DJ Delorie
> This is a common problem. I guess newlib/cygwin got the oldest set > and, afaik, the GCC toplevel stuff is kind of the master. It would > be nice if we had some automatism in place to keep all former src > repos in sync. There was never any agreement on who the "master" was for toplevel sourc

building against a temporary install dir?

2015-02-03 Thread DJ Delorie
So here's what I'm trying to do... I want to build gcc, binutils, and newlib, run tests, and IF the tests pass, THEN install them all. However, gcc needs an installed newlib to build it's libraries. I tried installing newlib into $DESTDIR$PREFIX but gcc ignores $DESTDIR during the compile. Any

Re: Rename C files to .c in GCC source

2015-01-31 Thread DJ Delorie
> Aren't current Windows file systems case-preserving? Then they > shouldn't have no problems with .C files. They are case preserving, but not case sensitive. A wildcard search for *.c will match foo.C and bar.c, and foo.c can be opened as FOO.C.

Re: Rename C files to .c in GCC source

2015-01-30 Thread DJ Delorie
pins...@gmail.com writes: > No because they are c++ code so capital C is correct. However, we should avoid relying on case-sensitive file systems (Windows) and use .cc or .cxx for C++ files ("+" is not a valid file name character on Windows, so we can't use .c++).

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
> Ok, but the converse — if the general_operand is accessed by more > than one instruction, it is not safe — is correct, right? In general, I'd agree, but the ISO spec talks about "sequence points" and there are times when you *can* access a volatile multiple times as long as the state is correct

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
> To try to generalize from that: it looks like the operating > principle is that an insn that expands into multiple references to a > given operand isn’t volatile-safe, but one where there is only a > single reference is safe? No, if the expanded list of insns does "what the standard says, no mo

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
> I looked in the documentation and didn’t see this described. AFAIK it's not documented. Only recently was it agreed (and even then, reluctantly) that the ISO spec could be met by such opcodes.

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
> One question: do you have an example of a non-volatile-safe machine so > I can get a feel for the problems one might encounter? At best I can > imagine a machine that optimizes "add 0, [mem]" to avoid the > read/write, but I'm not aware of such an ISA. For example, the MSP430 backend uses a ma

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
> What is involved with the auditing? Each pattern that (directly or indirectly) uses general_operand, memory_operand, or nonimmediate_operand needs to be checked to see if it's volatile-safe. If so, you need to change the predicate to something that explicitly accepts volatiles. There's been t

Re: volatile access optimization (C++ / x86_64)

2015-01-05 Thread DJ Delorie
Matt Godbolt writes: > GCC's code generation uses a "load; add; store" for volatiles, instead > of a single "add 1, [metric]". GCC doesn't know if a target's load/add/store patterns are volatile-safe, so it must avoid them. There are a few targets that have been audited for volatile-safe-ness s

Re: pointer math vs named address spaces

2014-12-03 Thread DJ Delorie
> However, pointer subtraction still returns ptrdiff_t, and sizeof still > returns size_t, Why?

pointer math vs named address spaces

2014-12-03 Thread DJ Delorie
If a target (rl78-elf in my case) has a named address space larger than the generic address space (__far in my case), why is pointer math in that named address space still truncated to sizetype? N1275 recognizes that named address spaces might be a different size than the generic address space, b

Re: libgcc - SJLJ probe failing on head on h8300 & m32c

2014-11-05 Thread DJ Delorie
Last time you mentioned this, I asked what the contents of that config.log were...

push_rounding vs memcpy vs stack_pointer_delta

2014-08-28 Thread DJ Delorie
The m32c-elf with -mcpu=m32c has a word-aligned stack and uses pushes for arguments (i.e. not accumulate_outgoing_args). In this test case, one of the arguments is memcpy'd into place, and an assert fails: typedef struct { int a, b, c, d, e, f, g, h; } foo; int x; void dj (int a, int b, foo c)

Re: m32c-*-* Build Issue (Multilib?)

2014-07-17 Thread DJ Delorie
> What's the next step? Someone finds time and desire to debug it ;-)

Re: m32c-*-* Build Issue (Multilib?)

2014-07-17 Thread DJ Delorie
> We see other failures in the log because newlib/targ-include > isn't created. The rtems build include path includes that and > needs it but it isn't created before libgcc is built. That isn't a > problem on other targets. I don't see anything odd in the top > configurery magic for m32c which co

Re: m32c-*-* Build Issue (Multilib?)

2014-07-17 Thread DJ Delorie
I just tried a 4.9.1 build and got this error: configure:4222: checking whether to use setjmp/longjmp exceptions configure:: /greed/dj/gnu/gcc/m32c-elf/gcc-4_9-branch/./gcc/xgcc -B/greed/dj/gnu/gcc/m32c-elf/gcc-4_9-branch/./gcc/ -B/greed/dj/m32c/install/m32c-elf/bin/ -B/greed/dj/m32c/install/m3

Re: reverse bitfield patch

2014-07-07 Thread DJ Delorie
> Ok, but as we are dealing exclusively with bitfields there is > already output_constructor_bitfield which uses an intermediate > state to "pack" bits into units that are then emitted. It shouldn't > be hard to change that to make it pack into the appropriate bits > instead. That assumes that t

Re: reverse bitfield patch

2014-07-01 Thread DJ Delorie
Revisiting an old thread, as I still want to get this feature in... https://gcc.gnu.org/ml/gcc/2012-10/msg00099.html > >> Why do you need to change varasm.c at all? The hunks seem to be > >> completely separate of the attribute. > > > > Because static constructors have fields in the original or

Re: question about GTY macro

2014-05-09 Thread DJ Delorie
> Likewise. See how global_trees is marked for example. But likely > you forgot to mark struct int_n_trees_t to be considered for GC. I did remember int_n_trees_t, but it seems to be working now, so who knows what I was doing wrong :-P Thanks!

question about GTY macro

2014-05-07 Thread DJ Delorie
Given this in tree.h: struct int_n_trees_t { tree signed_type; tree unsigned_type; }; extern struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS]; And this in tree.c: struct int_n_trees_t int_n_trees [NUM_INT_N_ENTS]; What is the right way to mark these for garbage collection? I

Re: stack-protection vs alloca vs dwarf2

2014-04-17 Thread DJ Delorie
> The "mov.L r6, r0" instruction must never be marked as frame-related, for any > function. Also, is that rule true if we *don't* have a frame pointer? That is, when we add a constant to the stack to allocate the frame, should that function be marked as frame-related? Or is it just the fp->sp

Re: stack-protection vs alloca vs dwarf2

2014-04-17 Thread DJ Delorie
> The "mov.L r6, r0" instruction must never be marked as frame-related, for any > function. Is this documented somewhere?

Re: stack-protection vs alloca vs dwarf2

2014-04-17 Thread DJ Delorie
> I gather that r0 is the stack pointer and r6 the frame pointer? Yes. > > 0014 0030 FDE cie= pc=..0043 > > DW_CFA_advance_loc4: 2 to 0002 > > DW_CFA_def_cfa_offset: 32 > > DW_CFA_offset: r12 at cfa-8 > > . . . > > DW_CFA_offset: r6 at cfa-32 >

Re: stack-protection vs alloca vs dwarf2

2014-04-17 Thread DJ Delorie
> Presumably the rx back-end and more precisely TARGET_FRAME_POINTER_REQUIRED, > which needs to return true if cfun->calls_alloca. The rx back-end doesn't define TARGET_FRAME_POINTER_REQUIRED, as the documentation says the compiler handles target-independent reasons why there needs to be a frame

stack-protection vs alloca vs dwarf2

2014-04-16 Thread DJ Delorie
While debugging some gdb-related FAILs, I discovered that gcc's -fstack-check option effectively calls alloca() to adjust the stack pointer. However, it doesn't mark the stack adjustment as FRAME_RELATED even when it's setting up the local variables for the function. In the case of rx-elf, for t

Re: RL78 sim?

2014-03-31 Thread DJ Delorie
> So far I've been testing with hardware but I'm pretty sure I read > somewhere about an RL78 simulator, which would be a useful addition. > Does this simulator exist, and if so, how do I run the tests against it? The simulator is part of the GDB build. > I tried 'make -k check RUNTESTFLAGS="-

Re: Testing machine descriptions

2014-03-27 Thread DJ Delorie
Is there some way to get insight into which alternatives get used during a coverage run?

Re: Testing machine descriptions

2014-03-27 Thread DJ Delorie
The main testsuite doesn't have tests specifically to cover all the md entries. What I meant was, I suspect it covers enough plain C test cases to happen to use all the usual md entries. Since each target has different md entries (both "which are used" and "how each is used"), it would be nearly

Re: Testing machine descriptions

2014-03-27 Thread DJ Delorie
I've thought about making a dejagnu testsuite specifically for helping with new ports, which would mean lots of md-specific tests, but really, the main testsuite probably covers everything you'd need to test. All patches are supposed to be regression tested anyway, which means running the full de

Re: [RL78] Questions about code-generation

2014-03-21 Thread DJ Delorie
> Is it possible that the virtual pass causes inefficiencies in some > cases by sticking with r8-r31 when one of the 'normal' registers > would be better? That's not a fair question to ask, since the virtual pass can *only* use r8-r31. The first bank has to be left alone else the devirtualizer b

Re: [RL78] Questions about code-generation

2014-03-16 Thread DJ Delorie
This is similar to what I had to do for msp430 - I made a new constraint that was what general_operand would have done if it allowed volatile MEMs, and used that for instructions where a volatile's volatileness wouldn't be broken.

Re: [RL78] Questions about code-generation

2014-03-16 Thread DJ Delorie
> Maybe we should add a target hook/macro to control this to avoid > duplicated code of 'general_operand' in various places? Even in the msp430, not all patterns can be safely used with volatile MEMs (i.e. the macro patterns). So, not all general_operand's were replaced.

Re: Legitimize address after reload

2014-03-14 Thread DJ Delorie
David Guillen writes: > In any case I'm not using the restrict variable and I'm assuming > strict is zero, this is, not checking the hard regsiters themselves. > This is because any reg is OK for base reg. I'm pretty sure I'm > behaving similarly to arm, cris or x86 backends. "strict" doesn't me

Re: [RL78] Questions about code-generation

2014-03-10 Thread DJ Delorie
> I'm curious. Have you tried out other approaches before you decided > to go with the virtual registers? Yes. Getting GCC to understand the "unusual" addressing modes the RL78 uses was too much for the register allocator to handle. Even when the addressing modes are limited to "usual" ones, G

Re: [RL78] Questions about code-generation

2014-03-10 Thread DJ Delorie
> Ah, that certainly explains a lot. How exactly would the fixing be > done? Is there an example I could look at for one of the other processors? No, RL78 is the first that uses this scheme. > I calculated a week or two ago that we could make a code-saving of > around 8% by using near or rel

Re: [RL78] Questions about code-generation

2014-03-10 Thread DJ Delorie
> I've managed to build GCC myself so that I could experiment a bit > but as this is my first foray into compiler internals, I'm > struggling to work out how things fit together and what affects > what. The key thing to know about the RL78 backend, is that it has two "targets" it uses. For the f

Re: MSP430 in gcc4.9 ... enable interrupts?

2014-02-17 Thread DJ Delorie
> I presume these will be part of the headers for the library > distributed for msp430 gcc by TI/Redhat? I can't speak for TI's or Red Hat's plans. GNU's typical non-custom embedded runtime is newlib/libgloss, which usually doesn't have that much in the way of chip-specific headers or library fu

Re: MSP430 in gcc4.9 ... enable interrupts?

2014-02-14 Thread DJ Delorie
The constructs in the *.md files are for the compiler's internal use (i.e. there are function attributes that trigger those). You don't need compiler support for these opcodes at the user level; the right way is to implement those builtins as inline assembler in a common header file: static inli

Re: proposal to make SIZE_TYPE more flexible

2014-01-28 Thread DJ Delorie
> Repost on the patches list (with self-contained write-up, rationale for > choices made, etc.) at the start of stage 1 for 4.10/5.0, Ok. > I suggest (this clearly isn't stage 3 material). Yup. Would be nice to back port it to 4.9 later, but... understood.

Re: proposal to make SIZE_TYPE more flexible

2014-01-28 Thread DJ Delorie
Ping? Or do I need to repost on the patches list? http://gcc.gnu.org/ml/gcc/2014-01/msg00130.html

Re: proposal to make SIZE_TYPE more flexible

2014-01-08 Thread DJ Delorie
> I don't see constants in that test. // Test for int128 enums. // { dg-do compile { target int128 } } // { dg-options "" } enum E { e1 = 0x, e2, e3 } e = e3; #define SA(I,X) int a##I[(X)? 1 : -1] SA(1, sizeof(E) == sizeof(__int128)); > Integer constant types should be tak

Re: proposal to make SIZE_TYPE more flexible

2014-01-08 Thread DJ Delorie
> I think a patch is more useful once believe feature-complete, which > means replacing the __int128 support with the new mechanism. One of the side-effects of taking out the existing __int128 support is that __int128 isn't in the integer_type_kind list, so isn't a type that is usable for constan

Re: proposal to make SIZE_TYPE more flexible

2013-12-20 Thread DJ Delorie
Ok, so I've got it checking for existing types and checking the target for supported modes. Any other features, or is it time for a second patch? Should I cut out the __int128 parts yet, or do you just want to see the new code still? To-Do: C++ parser, C++ mangling. Still no idea what to do ab

Re: proposal to make SIZE_TYPE more flexible

2013-12-20 Thread DJ Delorie
> I think using the macros for type sizes is fine, and float / vector / > complex types are completely irrelevant to this (so standard_type_bitsize > should maybe be standard_integer_type_bitsize). Whew. Am I missing any in the previous code snippet (char, short, int, long, long long) ? Those

Re: proposal to make SIZE_TYPE more flexible

2013-12-20 Thread DJ Delorie
> This seems mostly plausible, though I don't see anything to ensure that > __intN does not exist at all if the size matches one of the standard C > types, or if the mode fails targetm.scalar_mode_supported_p. What do we check against for this? Is there some table of standard types we can read

Re: proposal to make SIZE_TYPE more flexible

2013-12-19 Thread DJ Delorie
Where is the right place to set the array of "this __intN mode is enabled" flags? I initially set it in tree.c where __int128 is set up, but that happens *after* c_parse_init() needs the flag to set up the RID_* keywords for them. Alternately, should I be calling targetm.scalar_mode_supported_p(

Re: proposal to make SIZE_TYPE more flexible

2013-12-10 Thread DJ Delorie
> (For the types you do have, there's a need to define C++ name mangling. I mentioned this before, and I don't have a good solution for it. Both C++ and LTO need a mangled form of __intN types.

Re: proposal to make SIZE_TYPE more flexible

2013-12-10 Thread DJ Delorie
> This seems mostly plausible, though I don't see anything to ensure that > __intN does not exist at all if the size matches one of the standard C > types, My thought here was that, since each __intN is specified by the target, they'd know to only do so if it doesn't match an existing (for that

Re: proposal to make SIZE_TYPE more flexible

2013-12-09 Thread DJ Delorie
First pass at actual code. I took the path of using a new macro in TARGET-modes.def and having genmodes build the relevent tables. Part of the table is created by genmodes, the rest is created at runtime. genmodes: bitsize, mode. runtime: signed/unsigned type trees (eventually, flag for "tar

Re: proposal to make SIZE_TYPE more flexible

2013-11-22 Thread DJ Delorie
> In general you need to analyze each such case individually to produce a > reasoned argument for what it should logically be doing. Given such > analyses, maybe then you can identify particular tables of types in > particular orders (for example) that should be set up to iterate through. Ok,

Re: proposal to make SIZE_TYPE more flexible

2013-11-22 Thread DJ Delorie
> (more precisely, for int128_integer_type_node to cease to exist and > for any front-end places needing it to call a function, with a type > size that should not be a constant 128). The complications I've seen there is, for example, when you're iterating through types looking for a "best" type,

Re: proposal to make SIZE_TYPE more flexible

2013-11-15 Thread DJ Delorie
> Everything handling __int128 would be updated to work with a > target-determined set of types instead. > > Preferably, the number of such keywords would be arbitrary (so I suppose > there would be a single RID_INTN for them) - that seems cleaner than the > system for address space keywords w

Re: proposal to make SIZE_TYPE more flexible

2013-11-14 Thread DJ Delorie
> If you do want types without corresponding modes, that goes back to > having a hook to list the relevant type sizes. Perhaps a FRACTIONAL_INT_TYPE() macro then, for when there's no machine mode to go with it? Although I'm struggling to imagine a case where a target would need to define a bit-s

Re: proposal to make SIZE_TYPE more flexible

2013-11-14 Thread DJ Delorie
> That would be one possibility - if the idea is to define __intN for all > integer modes not matching a standard type (and passing > targetm.scalar_mode_supported_p), I advise posting details of what effect > this would have for all targets so we can see how many such types would > get added.

Re: proposal to make SIZE_TYPE more flexible

2013-11-14 Thread DJ Delorie
> Instead of a target-independent __int128 keyword, there would be a set > (possibly empty) of __intN keywords, determined by a target hook. Or *-modes.def ?

Re: proposal to make SIZE_TYPE more flexible

2013-11-13 Thread DJ Delorie
> > So, given all that, is there any way to add the "target-specific > > size_t" portion without waiting for-who-knows-how-long for the intN_t > > and enum-size-type projects to finish? Some form of interim API that > > we can put in, so that we can start working on finding all the > > assumption

weird logic about redeclaring builtins...

2013-10-31 Thread DJ Delorie
Given the logic in c/c-decl.c's diagnose_mismatched_decls, if a built-in function is *also* declared in a system header (which is common with newlib), gcc fails to mention either the builtin or the declaration if you redeclare the function as something else. I.e. this code: int foo();

Re: proposal to make SIZE_TYPE more flexible

2013-10-30 Thread DJ Delorie
So, given all that, is there any way to add the "target-specific size_t" portion without waiting for-who-knows-how-long for the intN_t and enum-size-type projects to finish? Some form of interim API that we can put in, so that we can start working on finding all the assumptions about size_t, whil

Re: proposal to make SIZE_TYPE more flexible

2013-10-30 Thread DJ Delorie
> It is a deficiency that SIZE_TYPE is defined to be a string at all (and > likewise for all the other target macros for standard typedefs including > all those for ). Separately, it's a deficiency that these > things are target macros rather than target hooks. My thought was that there'd be

proposal to make SIZE_TYPE more flexible

2013-10-29 Thread DJ Delorie
There are a couple of places in gcc where wierd-sized pointers are an issue. While you can use a partial-integer mode for pointers, the pointer *math* is still done in standard C types, which usually don't match the modes of pointers and often result in suboptimal code. My proposal is to allow t

question about register pairs

2013-10-23 Thread DJ Delorie
The docs say to use HARD_REGNO_MODE_OK to enforce register pairs. But reload (find_valid_class_1) rejects classes that include such registers: for (regno = 0; regno < FIRST_PSEUDO_REGISTER && !bad; regno++) { if (in_hard_reg_set_p (reg_class_contents[rclass], mode, regno)

Re: Invalid tree node causes segfault in diagnostic

2013-10-11 Thread DJ Delorie
> While I am at it, can I patch backends as well? For example > mep/mep.c has an occurrence of tree_code_name[TREE_CODE (... The mep change is pre-approved :-)

  1   2   3   4   5   6   7   8   >