9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] C compiler error?
@ 2011-12-13 12:42 Lucio De Re
  2011-12-13 13:36 ` erik quanstrom
  2011-12-13 13:57 ` Anthony Martin
  0 siblings, 2 replies; 17+ messages in thread
From: Lucio De Re @ 2011-12-13 12:42 UTC (permalink / raw)
  To: 9fans

New features in Go require a new function in the reflect.c module
(src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
error which does not seem to apply:

8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
../gc/reflect.c:987 switch expression must be integer

This is a bit of a stumbling block.  I'm hoping there's someone on
this mailing list that can address this problem quicker than it would
be possible for me.  More details off line.

++L




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 12:42 [9fans] C compiler error? Lucio De Re
@ 2011-12-13 13:36 ` erik quanstrom
  2011-12-13 13:52   ` Noah Evans
       [not found]   ` <CAJVRB2XJ2KOC1sGd+Tb3a-3ZL7Jan9OEKH+oEWWTnutQ3M-cxg@mail.gmail.c>
  2011-12-13 13:57 ` Anthony Martin
  1 sibling, 2 replies; 17+ messages in thread
From: erik quanstrom @ 2011-12-13 13:36 UTC (permalink / raw)
  To: lucio, 9fans

On Tue Dec 13 07:43:08 EST 2011, lucio@proxima.alt.za wrote:
> New features in Go require a new function in the reflect.c module
> (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
> error which does not seem to apply:
>
> 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
> ../gc/reflect.c:987 switch expression must be integer
>
> This is a bit of a stumbling block.  I'm hoping there's someone on
> this mailing list that can address this problem quicker than it would
> be possible for me.  More details off line.

i don't see 987 lines in reflect.c.  from http://golang.org/src/cmd/gc/reflect.c,
i only see 939.

in any event, it's likely that your switch type is a uvlong.  8c doesn't allow
that.

- erik



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 13:36 ` erik quanstrom
@ 2011-12-13 13:52   ` Noah Evans
       [not found]   ` <CAJVRB2XJ2KOC1sGd+Tb3a-3ZL7Jan9OEKH+oEWWTnutQ3M-cxg@mail.gmail.c>
  1 sibling, 0 replies; 17+ messages in thread
From: Noah Evans @ 2011-12-13 13:52 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: lucio

Erik, are you looking at the tip? IIRC the webpage points to a stable
version not the tip.

Noah



On Tue, Dec 13, 2011 at 2:36 PM, erik quanstrom <quanstro@quanstro.net> wrote:
> On Tue Dec 13 07:43:08 EST 2011, lucio@proxima.alt.za wrote:
>> New features in Go require a new function in the reflect.c module
>> (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
>> error which does not seem to apply:
>>
>> 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
>> ../gc/reflect.c:987 switch expression must be integer
>>
>> This is a bit of a stumbling block.  I'm hoping there's someone on
>> this mailing list that can address this problem quicker than it would
>> be possible for me.  More details off line.
>
> i don't see 987 lines in reflect.c.  from http://golang.org/src/cmd/gc/reflect.c,
> i only see 939.
>
> in any event, it's likely that your switch type is a uvlong.  8c doesn't allow
> that.
>
> - erik
>



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
       [not found]   ` <CAJVRB2XJ2KOC1sGd+Tb3a-3ZL7Jan9OEKH+oEWWTnutQ3M-cxg@mail.gmail.c>
@ 2011-12-13 13:55     ` erik quanstrom
  2011-12-13 14:07       ` yy
  0 siblings, 1 reply; 17+ messages in thread
From: erik quanstrom @ 2011-12-13 13:55 UTC (permalink / raw)
  To: noah.evans, 9fans, lucio

On Tue Dec 13 08:53:25 EST 2011, noah.evans@gmail.com wrote:
> Erik, are you looking at the tip? IIRC the webpage points to a stable
> version not the tip.

well too bad, no option to peek at the tip either.

in any event, i still bet you're switching on a uvlong.

- erik



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 12:42 [9fans] C compiler error? Lucio De Re
  2011-12-13 13:36 ` erik quanstrom
@ 2011-12-13 13:57 ` Anthony Martin
  1 sibling, 0 replies; 17+ messages in thread
From: Anthony Martin @ 2011-12-13 13:57 UTC (permalink / raw)
  To: lucio, Fans of the OS Plan 9 from Bell Labs

Lucio De Re <lucio@proxima.alt.za> once said:
> New features in Go require a new function in the reflect.c module
> (src/cmd/gc/reflect.c).  The C compiler (8c, in this case) reports an
> error which does not seem to apply:
>
> 8c -I/go/include -I/go/386/include -FTVw ../gc/reflect.c
> ../gc/reflect.c:987 switch expression must be integer
>
> This is a bit of a stumbling block.  I'm hoping there's someone on
> this mailing list that can address this problem quicker than it would
> be possible for me.  More details off line.

Yup.  8c won't allow this.  If you we're using 6c
you could have a vlong in a switch expression.

I sent out a CL for this:
https://codereview.appspot.com/5486049/

  Anthony



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 13:55     ` erik quanstrom
@ 2011-12-13 14:07       ` yy
  2011-12-13 22:38         ` Charles Forsyth
  0 siblings, 1 reply; 17+ messages in thread
From: yy @ 2011-12-13 14:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

2011/12/13 erik quanstrom <quanstro@quanstro.net>:
> On Tue Dec 13 08:53:25 EST 2011, noah.evans@gmail.com wrote:
>> Erik, are you looking at the tip? IIRC the webpage points to a stable
>> version not the tip.
>
> well too bad, no option to peek at the tip either.
>

http://tip.golang.org/src/cmd/gc/reflect.c

(weekly.golang.org is there too)


--
- yiyus || JGL .



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 14:07       ` yy
@ 2011-12-13 22:38         ` Charles Forsyth
  2011-12-13 23:01           ` Russ Cox
  0 siblings, 1 reply; 17+ messages in thread
From: Charles Forsyth @ 2011-12-13 22:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

it's reasonable to use any integer type in a switch, although the compilers
don't currently support it.
it's compatible with the standard, which allows any integer type. i'd
cancel the change request and work round it (add a cast) until
the compilers can be changed to support it.

[-- Attachment #2: Type: text/html, Size: 335 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 22:38         ` Charles Forsyth
@ 2011-12-13 23:01           ` Russ Cox
  2011-12-14  4:05             ` Lucio De Re
  0 siblings, 1 reply; 17+ messages in thread
From: Russ Cox @ 2011-12-13 23:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Dec 13, 2011 at 5:38 PM, Charles Forsyth
<charles.forsyth@gmail.com> wrote:
> it's reasonable to use any integer type in a switch, although the compilers
> don't currently support it.
> it's compatible with the standard, which allows any integer type. i'd cancel
> the change request and work round it (add a cast) until
> the compilers can be changed to support it.

http://codereview.appspot.com/5485063/ is a step toward it.
it doesn't generate the prettiest code but i think it works.

russ


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-13 23:01           ` Russ Cox
@ 2011-12-14  4:05             ` Lucio De Re
  2011-12-14  4:08               ` Lucio De Re
  2011-12-14  4:19               ` Russ Cox
  0 siblings, 2 replies; 17+ messages in thread
From: Lucio De Re @ 2011-12-14  4:05 UTC (permalink / raw)
  To: rsc, 9fans

> On Tue, Dec 13, 2011 at 5:38 PM, Charles Forsyth
 (add a cast) until
>> the compilers can be changed to support it.
>
> http://codereview.appspot.com/5485063/ is a step toward it.
> it doesn't generate the prettiest code but i think it works.
>
What is the expected status?  Is Anthony's CL to be abandoned in
favour of the change to the Plan 9 C compiler (give or take the other
nit of a "static" definition)?  I don't have a problem with minor
unofficial changes to the Plan 9 distribution, but others may object.

Lucio.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14  4:05             ` Lucio De Re
@ 2011-12-14  4:08               ` Lucio De Re
  2011-12-14  4:19               ` Russ Cox
  1 sibling, 0 replies; 17+ messages in thread
From: Lucio De Re @ 2011-12-14  4:08 UTC (permalink / raw)
  To: lucio, 9fans

[-- Attachment #1: Type: text/plain, Size: 42 bytes --]

Was meant as private mail, sorry!

++L

[-- Attachment #2: Type: message/rfc822, Size: 3786 bytes --]

From: Lucio De Re <lucio@proxima.alt.za>
To: rsc@swtch.com, 9fans@9fans.net
Subject: Re: [9fans] C compiler error?
Date: Wed, 14 Dec 2011 06:05:10 +0200
Message-ID: <1327f5027eaa9481a13e08f02cae8327@proxima.alt.za>

> On Tue, Dec 13, 2011 at 5:38 PM, Charles Forsyth
 (add a cast) until
>> the compilers can be changed to support it.
>
> http://codereview.appspot.com/5485063/ is a step toward it.
> it doesn't generate the prettiest code but i think it works.
>
What is the expected status?  Is Anthony's CL to be abandoned in
favour of the change to the Plan 9 C compiler (give or take the other
nit of a "static" definition)?  I don't have a problem with minor
unofficial changes to the Plan 9 distribution, but others may object.

Lucio.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14  4:05             ` Lucio De Re
  2011-12-14  4:08               ` Lucio De Re
@ 2011-12-14  4:19               ` Russ Cox
  2011-12-14  9:20                 ` Charles Forsyth
  1 sibling, 1 reply; 17+ messages in thread
From: Russ Cox @ 2011-12-14  4:19 UTC (permalink / raw)
  To: lucio; +Cc: 9fans

On Tue, Dec 13, 2011 at 11:05 PM, Lucio De Re <lucio@proxima.alt.za> wrote:
> What is the expected status?  Is Anthony's CL to be abandoned in
> favour of the change to the Plan 9 C compiler (give or take the other
> nit of a "static" definition)?  I don't have a problem with minor
> unofficial changes to the Plan 9 distribution, but others may object.

Since you sent this publicly, I will reply publicly.
We're not going to change the Go code to avoid
switches on 64-bit numbers, which are increasingly
common.  I assume that Anthony will take care of
submitting the patch through the usual channels
and getting it applied.

Russ


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14  4:19               ` Russ Cox
@ 2011-12-14  9:20                 ` Charles Forsyth
  2011-12-14 10:10                   ` Anthony Martin
  0 siblings, 1 reply; 17+ messages in thread
From: Charles Forsyth @ 2011-12-14  9:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 828 bytes --]

>  Is Anthony's CL to be abandoned in favour of the change to the Plan 9 C
compiler (give or take the other nit of a "static" definition)?

see my earlier remark:

"it's reasonable to use any integer type in a switch, although the
compilers don't currently support it.
it's compatible with the standard, which allows any integer type. *i'd
cancel the change request and work round it* (eg, add a cast) until
the compilers can be changed to support it."

Instead of making a small patch to the Go file locally, you could also
apply Russ's change locally to 8c, which might be easier.
That change will keep you going, but it doesn't look like a good one as it
stands to apply to the full compiler suite.
As my remark above suggests, the compiler suite should, however, support
using any integer type in a switch.

[-- Attachment #2: Type: text/html, Size: 1673 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14  9:20                 ` Charles Forsyth
@ 2011-12-14 10:10                   ` Anthony Martin
  2011-12-14 10:29                     ` Charles Forsyth
  0 siblings, 1 reply; 17+ messages in thread
From: Anthony Martin @ 2011-12-14 10:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Charles Forsyth <charles.forsyth@gmail.com> once said:
I abandoned my old CL and sent another that
allows 64-bit switch expressions for all of
the Go compilers.  A patch for [5678kqv]c
will be hitting sources soon.  Stay tuned.

  Anthony



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14 10:10                   ` Anthony Martin
@ 2011-12-14 10:29                     ` Charles Forsyth
  2011-12-14 10:34                       ` Charles Forsyth
  2011-12-15  2:59                       ` Anthony Martin
  0 siblings, 2 replies; 17+ messages in thread
From: Charles Forsyth @ 2011-12-14 10:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]

that's a little tidier, but still not right. the original pswt.c code was
fine (or nearly so). the problem is
actually in 8c's handling of 64-bit values and registers.

On 14 December 2011 10:10, Anthony Martin <ality@pbrane.org> wrote:

> Charles Forsyth <charles.forsyth@gmail.com> once said:
> I abandoned my old CL and sent another that
> allows 64-bit switch expressions for all of
> the Go compilers.  A patch for [5678kqv]c
> will be hitting sources soon.  Stay tuned.
>
>  Anthony
>
>

[-- Attachment #2: Type: text/html, Size: 850 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14 10:29                     ` Charles Forsyth
@ 2011-12-14 10:34                       ` Charles Forsyth
  2011-12-15  2:59                       ` Anthony Martin
  1 sibling, 0 replies; 17+ messages in thread
From: Charles Forsyth @ 2011-12-14 10:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

it would also help if I actually pushed the 64-bit changes for 5c, i
suppose.
how lucky i've recently got a machine to re-test them!

On 14 December 2011 10:29, Charles Forsyth <charles.forsyth@gmail.com>wrote:

> that's a little tidier, but still not right. the original pswt.c code was
> fine (or nearly so). the problem is
> actually in 8c's handling of 64-bit values and registers.
>

[-- Attachment #2: Type: text/html, Size: 661 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-14 10:29                     ` Charles Forsyth
  2011-12-14 10:34                       ` Charles Forsyth
@ 2011-12-15  2:59                       ` Anthony Martin
  2011-12-15  9:02                         ` Charles Forsyth
  1 sibling, 1 reply; 17+ messages in thread
From: Anthony Martin @ 2011-12-15  2:59 UTC (permalink / raw)
  To: Charles Forsyth; +Cc: Fans of the OS Plan 9 from Bell Labs

Charles Forsyth <charles.forsyth@gmail.com> once said:
> that's a little tidier, but still not right. the original
> pswt.c code was fine (or nearly so). the problem is
> actually in 8c's handling of 64-bit values and registers.

I'm not sure I understand entirely.  Could you
elaborate this a bit?  Also I'm a bit confused
about how uvlongs are handled in 8c.  Regalloc
seems to use D_F0 for signed vlongs which works
fine with the AFMOVV instructions but IIRC that
only works for signed 64-bit values.  To use an
unsigned value there would have to be some sort
of pre- and post-processing before a load or
store into the FP register.  I don't see code
for that anywhere.  Did I miss it?

Any help is appreciated.

Thanks,
  Anthony



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9fans] C compiler error?
  2011-12-15  2:59                       ` Anthony Martin
@ 2011-12-15  9:02                         ` Charles Forsyth
  0 siblings, 0 replies; 17+ messages in thread
From: Charles Forsyth @ 2011-12-15  9:02 UTC (permalink / raw)
  To: Anthony Martin; +Cc: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]

Reply-to wasn't quite right. Anyway, it's probably easiest to carry on off
the list for a while.

[-- Attachment #2: Type: text/html, Size: 121 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-12-15  9:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-13 12:42 [9fans] C compiler error? Lucio De Re
2011-12-13 13:36 ` erik quanstrom
2011-12-13 13:52   ` Noah Evans
     [not found]   ` <CAJVRB2XJ2KOC1sGd+Tb3a-3ZL7Jan9OEKH+oEWWTnutQ3M-cxg@mail.gmail.c>
2011-12-13 13:55     ` erik quanstrom
2011-12-13 14:07       ` yy
2011-12-13 22:38         ` Charles Forsyth
2011-12-13 23:01           ` Russ Cox
2011-12-14  4:05             ` Lucio De Re
2011-12-14  4:08               ` Lucio De Re
2011-12-14  4:19               ` Russ Cox
2011-12-14  9:20                 ` Charles Forsyth
2011-12-14 10:10                   ` Anthony Martin
2011-12-14 10:29                     ` Charles Forsyth
2011-12-14 10:34                       ` Charles Forsyth
2011-12-15  2:59                       ` Anthony Martin
2011-12-15  9:02                         ` Charles Forsyth
2011-12-13 13:57 ` Anthony Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).