* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
@ 2008-11-27 18:30 ` pinskia at gcc dot gnu dot org
2008-11-27 18:32 ` gnu at behdad dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 18:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-11-27 18:28 -------
Differences between two different arrays don't make sense really.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
2008-11-27 18:30 ` [Bug c/38295] " pinskia at gcc dot gnu dot org
@ 2008-11-27 18:32 ` gnu at behdad dot org
2008-11-27 18:33 ` gnu at behdad dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gnu at behdad dot org @ 2008-11-27 18:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from gnu at behdad dot org 2008-11-27 18:31 -------
I'm not following. Why arrays? Those are pointers, and their difference is
known at compile time.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
2008-11-27 18:30 ` [Bug c/38295] " pinskia at gcc dot gnu dot org
2008-11-27 18:32 ` gnu at behdad dot org
@ 2008-11-27 18:33 ` gnu at behdad dot org
2008-11-27 18:34 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gnu at behdad dot org @ 2008-11-27 18:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from gnu at behdad dot org 2008-11-27 18:32 -------
Oh, I see what you mean. Yes, I said in my report that this is
undefined/unsupported/... according to the C standard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
` (2 preceding siblings ...)
2008-11-27 18:33 ` gnu at behdad dot org
@ 2008-11-27 18:34 ` pinskia at gcc dot gnu dot org
2008-11-27 18:36 ` gnu at behdad dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2008-11-27 18:33 -------
(In reply to comment #2)
> I'm not following. Why arrays? Those are pointers, and their difference is
> known at compile time.
Not at compile time really, the difference is known at link time.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
` (3 preceding siblings ...)
2008-11-27 18:34 ` pinskia at gcc dot gnu dot org
@ 2008-11-27 18:36 ` gnu at behdad dot org
2008-11-27 18:53 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: gnu at behdad dot org @ 2008-11-27 18:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from gnu at behdad dot org 2008-11-27 18:35 -------
If the two functions are in the same compilation unit (and static), it's known
at compile time, isn't it?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
` (4 preceding siblings ...)
2008-11-27 18:36 ` gnu at behdad dot org
@ 2008-11-27 18:53 ` pinskia at gcc dot gnu dot org
2008-11-27 18:54 ` pinskia at gcc dot gnu dot org
2008-11-27 18:56 ` gnu at behdad dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 18:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-11-27 18:52 -------
(In reply to comment #5)
> If the two functions are in the same compilation unit (and static), it's known
> at compile time, isn't it?
Not always since they could be in different sections via -ffunction-sections or
the user put them into different sections. The layout of the sections is not
known until link time.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
` (5 preceding siblings ...)
2008-11-27 18:53 ` pinskia at gcc dot gnu dot org
@ 2008-11-27 18:54 ` pinskia at gcc dot gnu dot org
2008-11-27 18:56 ` gnu at behdad dot org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-27 18:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2008-11-27 18:53 -------
Also the linker could do some branch relaxation which causes the size to be
different based on the layout of the functions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38295] Support pointer difference as constant in static initializer
2008-11-27 18:20 [Bug c/38295] New: Support pointer difference as constant in static initializer gnu at behdad dot org
` (6 preceding siblings ...)
2008-11-27 18:54 ` pinskia at gcc dot gnu dot org
@ 2008-11-27 18:56 ` gnu at behdad dot org
7 siblings, 0 replies; 9+ messages in thread
From: gnu at behdad dot org @ 2008-11-27 18:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from gnu at behdad dot org 2008-11-27 18:55 -------
If they are asked to be put in different sections, sure, it will err. But
doesn't gcc already use relative calls for many static functions in the same
unit?
Let me back out: my request is: add gcc extension to support some way to
implement vtables that do not need (many) relocations.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38295
^ permalink raw reply [flat|nested] 9+ messages in thread