c/10824: ICE in gcc/gcc/intl/dcigettext.c on FreeBSD5

arno@heho.snv.jussieu.fr arno@heho.snv.jussieu.fr
Fri May 16 18:36:00 GMT 2003


>Number:         10824
>Category:       c
>Synopsis:       ICE in gcc/gcc/intl/dcigettext.c on FreeBSD5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 16 17:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     arno@heho.snv.jussieu.fr
>Release:        "3.4 20030516 (experimental)"
>Organization:
>Environment:

>Description:

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="dcigettext.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="dcigettext.c"

LyogSW1wbGVtZW50YXRpb24gb2YgdGhlIGludGVybmFsIGRjaWdldHRleHQgZnVuY3Rpb24uCiAg
IENvcHlyaWdodCAoQykgMTk5NS0xOTk5LCAyMDAwLCAyMDAxIEZyZWUgU29mdHdhcmUgRm91bmRh
dGlvbiwgSW5jLgoKICAgVGhpcyBwcm9ncmFtIGlzIGZyZWUgc29mdHdhcmU7IHlvdSBjYW4gcmVk
aXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQKICAgdW5kZXIgdGhlIHRlcm1zIG9mIHRoZSBH
TlUgTGlicmFyeSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFzIHB1Ymxpc2hlZAogICBieSB0aGUg
RnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uOyBlaXRoZXIgdmVyc2lvbiAyLCBvciAoYXQgeW91ciBv
cHRpb24pCiAgIGFueSBsYXRlciB2ZXJzaW9uLgoKICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1
dGVkIGluIHRoZSBob3BlIHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCiAgIGJ1dCBXSVRIT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Q7CiAgICAgIHRyYW5z
bWVtX2xpc3QgPSB0cmFuc21lbV9saXN0LT5uZXh0OwogICAgICBmcmVlIChvbGQpOwogICAgfQp9
Cgp0ZXh0X3NldF9lbGVtZW50IChfX2xpYmNfc3ViZnJlZXJlcywgZnJlZV9tZW0pOwojZW5kaWYK



More information about the Gcc-bugs mailing list