Debian Codegraph @

gcc/testsuite/gcc.c-torture/compile/BUG1.c

raw
1 /* { dg-additional-options "-std=gnu89" } */
2
3 struct _XtTextSource {
4 /* ... */
5 void (* SetSelection)();
6 /* ... */
7 };
8
9 typedef struct _XtTextSource *XtTextSource;
10
11 typedef struct _TextPart {
12 XtTextSource source;
13 /* ... */
14 } TextPart;
15
16 typedef struct _TextRec {
17 /* ... */
18 TextPart text;
19 } TextRec;
20
21 typedef struct _TextRec *TextWidget;
22
23
24 void XtTextUnsetSelection(w)
25 TextWidget w; /* original is: Widget w; */
26 {
27 register TextWidget ctx = (TextWidget) w;
28 void (*nullProc)() = 0;
29
30 /*
31 * the following line causes the error, when optimizing:
32 */
33
34 if (ctx->text.source->SetSelection != nullProc) {
35
36 foo();
37
38 }
39 }