aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/unsorted/BUG1.c
blob: ada8eaf49c71bd125afbc35a89550eabf18e39b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
struct _XtTextSource {
	/* ... */
    	void (* SetSelection)();
	/* ... */
    };

typedef struct _XtTextSource *XtTextSource;

typedef struct _TextPart {
    	XtTextSource source;
	/* ... */
} TextPart;

typedef struct _TextRec {
	/* ... */
	TextPart    text;
} TextRec;

typedef struct _TextRec      *TextWidget;


void XtTextUnsetSelection(w)
    TextWidget          w;		   /* original is: Widget w; */
{
    register TextWidget ctx = (TextWidget) w;
    void (*nullProc)() = 0;

/*
 * the following line causes the error, when optimizing:
 */

    if (ctx->text.source->SetSelection != nullProc) {

	foo();

    }
}