1 /* { dg-do compile } */
2 /* { dg-require-effective-target lp64 } */
3 /* { dg-options "-O2 -ftree-tail-merge" } */
4 
5 enum Lisp_Type
6 {
7   Lisp_Int0 = 0, Lisp_Int1 = 4, Lisp_Symbol = 2, Lisp_Misc = 3, Lisp_String =
8     1, Lisp_Vectorlike = 5, Lisp_Cons = 6, Lisp_Float = 7,
9 };
10 typedef long Lisp_Object;
11 enum pvec_type
12 {
13   PVEC_NORMAL_VECTOR = 0, PVEC_PROCESS = 0x200, PVEC_FRAME =
14     0x400, PVEC_COMPILED = 0x800, PVEC_WINDOW =
15     0x1000, PVEC_WINDOW_CONFIGURATION = 0x2000, PVEC_SUBR =
16     0x4000, PVEC_CHAR_TABLE = 0x8000, PVEC_BOOL_VECTOR =
17     0x10000, PVEC_BUFFER = 0x20000, PVEC_HASH_TABLE = 0x40000, PVEC_TERMINAL =
18     0x80000, PVEC_SUB_CHAR_TABLE = 0x100000, PVEC_FONT =
19     0x200000, PVEC_OTHER = 0x400000, PVEC_TYPE_MASK = 0x7ffe00
20 };
21 struct Lisp_Vector
22 {
23   unsigned long size;
24 };
25 struct Lisp_Char_Table
26 {
27   Lisp_Object defalt;
28   Lisp_Object ascii;
29 };
30 struct Lisp_Sub_Char_Table
31 {
32   Lisp_Object contents[1];
33 };
34 extern Lisp_Object Qnil, Qt, Qquote, Qlambda, Qsubr, Qunbound;
35 struct buffer_text
36 {
37   unsigned char *beg;
38   long gpt_byte;
39   long gap_size;
40 };
41 struct buffer
42 {
43   struct buffer_text *text;
44   struct region_cache *width_run_cache;
45   Lisp_Object tab_width;
46   Lisp_Object ctl_arrow;
47 };
48 extern struct buffer *current_buffer;
49 extern Lisp_Object Vchar_width_table;
50 struct frame
51 {
52   long text_lines, text_cols;
53 };
54 struct window
55 {
56   Lisp_Object frame;
57 };
58 extern Lisp_Object Vtruncate_partial_width_windows;
59 extern struct Lisp_Char_Table *window_display_table (struct window *);
60 struct position *
compute_motion(from,fromvpos,fromhpos,did_motion,to,tovpos,tohpos,width,hscroll,tab_offset,win)61 compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos,
62 		width, hscroll, tab_offset, win)
63      long from, fromvpos, fromhpos, to, tovpos, tohpos;
64      struct window *win;
65 {
66   register long hpos = fromhpos;
67   register long pos;
68   long pos_byte;
69   register int c = 0;
70   register struct Lisp_Char_Table *dp = window_display_table (win);
71   long wide_column_end_hpos = 0;
72   long continuation_glyph_width;
73   while (1)
74     {
75       if (hpos > width)
76 	{
77 	  int total_width = width + continuation_glyph_width;
78 	  if (!((Vtruncate_partial_width_windows) == (Qnil))
79 	      && (total_width <
80 		  (((void) 0,
81 		    (struct frame
82 		     *) ((long) (((win)->frame) & ~((((long) 1) << 3) -
83 						    1)))))->text_cols))
84 	    {
85 	      if (pos <= to)
86 		{
87 		  pos = find_before_next_newline (pos, to, 1);
88 		}
89 	      if (wide_column_end_hpos > width)
90 		{
91 		  hpos -= width;
92 		}
93 	    }
94 	}
95       else
96 	{
97 	  Lisp_Object charvec;
98 	  c =
99 	    *(((((pos_byte)) >=
100 		(current_buffer->text->gpt_byte) ? (current_buffer->text->
101 						    gap_size) : 0) +
102 	       ((pos_byte)) + (current_buffer->text->beg) - ((1))));
103 	  if (current_buffer->width_run_cache)
104 	    {
105 	      if (((((enum Lisp_Type) (((unsigned long) ((charvec))) &
106 				       ((((long) 1) << 3) - 1))) ==
107 		    Lisp_Vectorlike)
108 		   &&
109 		   !(((void) 0,
110 		      (struct Lisp_Vector
111 		       *) ((long) ((charvec) & ~((((long) 1) << 3) - 1))))->
112 		     size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
113 		{
114 		  unsigned char *ptr;
115 		  int bytes, width, wide_column;
116 		  do
117 		    {
118 		      if ((!((*ptr) & 0x80) ? 1 : !((*ptr) & 0x20) ? 2 :
119 			   !((*ptr) & 0x10) ? 3 : !((*ptr) & 0x08) ? 4 : 5) !=
120 			  bytes)
121 			width = bytes * 4;
122 		      else
123 			{
124 			  if (dp != 0
125 			      &&
126 			      ((((enum
127 				  Lisp_Type) (((unsigned
128 						long) (((((unsigned) (c) <
129 							  0x80)
130 							 ? ((((dp)->ascii) ==
131 							     (Qnil)) ? (dp)->
132 							    defalt
133 							    : (((((enum
134 								   Lisp_Type)
135 								  (((unsigned
136 								     long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && !(((void) 0, (struct Lisp_Vector *) ((long) (((((unsigned) (c) < 0x80) ? ((((dp)->ascii) == (Qnil)) ? (dp)->defalt : (((((enum Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size & ((((unsigned long) 1 << (64 - 1)) >> 1)))))
137 			    width =
138 			      ((void) 0,
139 			       (struct Lisp_Vector
140 				*) ((long) (((((unsigned) (c) <
141 					       0x80) ? ((((dp)->ascii) ==
142 							 (Qnil)) ? (dp)->
143 							defalt
144 							: (((((enum
145 							       Lisp_Type) (((unsigned long) (((dp)->ascii))) & ((((long) 1) << 3) - 1))) == Lisp_Vectorlike) && (((((void) 0, (struct Lisp_Vector *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->size & (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) == (((((unsigned long) 1 << (64 - 1)) >> 1)) | (PVEC_SUB_CHAR_TABLE)))) ? ((void) 0, (struct Lisp_Sub_Char_Table *) ((long) (((dp)->ascii) & ~((((long) 1) << 3) - 1))))->contents[c] : (dp)->ascii)) : disp_char_vector ((dp), (c)))) & ~((((long) 1) << 3) - 1))))->size;
146 			  else
147 			    width =
148 			      (((unsigned) (c) < 0x80) ? (c <
149 							  0x20 ? (c ==
150 								  '\t'
151 								  ? ((((long)
152 								       (current_buffer->
153 									tab_width))
154 								      >> (3 -
155 									  1)))
156 								  : (c ==
157 								     '\n' ? 0
158 								     : (((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2))) : (c < 0x7f ? 1 : ((((current_buffer->ctl_arrow) == (Qnil)) ? 4 : 2)))) : (((long) ((((unsigned) (c) < 0x80) ? (
159 																														       {
160 																														       Lisp_Object
161 																														       _val;
162 																														       _val;}
163 			):																							char_table_ref ((Vchar_width_table), (c))))) >> (3 - 1)));
164 			  if (width > 1)
165 			    wide_column = width;
166 			}
167 		    }
168 		  while (0);
169 		  if (wide_column)
170 		    wide_column_end_hpos = hpos + wide_column;
171 		}
172 	    }
173 	}
174     }
175 }
176